octave-maintainers
[Top][All Lists]
Advanced

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

Re: tempname vs. tmpnam


From: Daniel J Sebald
Subject: Re: tempname vs. tmpnam
Date: Wed, 22 Oct 2014 13:15:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 10/22/2014 12:50 PM, Rik wrote:
10/22/14

All,

I checked in a changeset which moves all of core Octave to using tempname
(http://hg.savannah.gnu.org/hgweb/octave/rev/6ca096827123).

It doesn't actually deprecate tmpnam, but it removes it from seealso links
in the documentation and from the manual.  If you type 'help tmpnam' it
returns a help string which mentions that tempname is preferred in new code.

Eventually we may fully deprecate it, but not for a while.

What about "tmpfile"? It seems odd to have "tempname", "tempdir" and then "tmpfile". But I could see keeping "tmpfile" if there is a clear explanation as to why it should be that way. "tmpfile" is similar to "tempname" with the extra step of actually opening the file...but not quite the same. "tmpfile" does not have the option of a DIR so does that mean that files from "tmpfile" reside in the "/tmp" directory? Is that justification for calling it "tmpfile"? Options would be

1) Leave as is, with perhaps an explanation for why "tmp" rather than "temp".

2) Similar to "tmpnam"/"tempname", rename to "tempfile" and deprecate "tmpfile".

3) Create a "tempfile" perhaps having the same input options as "tempname" (and probably consist of calling tempname() and then adding a few lines of code to attempt opening the file). Rename "tmpfile" to "P_tmpfile".

??

Dan



reply via email to

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