octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keeping both tmpnam and tempname?


From: Mike Miller
Subject: Re: Keeping both tmpnam and tempname?
Date: Wed, 8 Oct 2014 09:05:20 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Oct 08, 2014 at 09:39:45 +0200, Philip Nienhuis wrote:
> Daniel J Sebald wrote:
> >But as for the tmpnam/tempname debate.  It looks like tmpnam came first
> >because the documentation for "tempname" refers to "see tmpfile".  I'm
> >assuming tmpnam and tmpfile were an original pair.  So to have
> >"tempname" associated with "tmpfile" as opposed to "tempfile" seems odd.
> 
> My point is rather that there is probably quite a bit of code around having
> tmpnam, that needs to be changed just to clean up a bit (IMO) of clutter w/o
> much maintenance overhead.

And that may be a good enough reason to keep both. I have done a quick
search through some Forge packages and found a mix of both names used
throughout.

> tempname is the ML equivalent, so I suppose it has been implemented later
> for the sake of compatibility.

Is there a reason it couldn't be turned into a true builtin alias rather
than an m-file wrapper? Or rather, make the builtin function be tempname
and make tmpnam be a builtin alias? That would significantly lower the
maintenance burden.

> BTW, Octave's P_tmpdir and tempdir have about the same issue; but I surmise
> these commands are used less frequently.

Not quite the same, P_tmpdir is a compiled-in constant string for what
your operating system says the default temporary directory is. But
tempdir can be redefined by setting the standard TMPDIR environment
variable.

> OK I shut up now, I've made my point.

All good points :)

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]