On Thursday, December 5, 2002, at 01:26 PM, <[EMAIL PROTECTED]> wrote:
On Thu, 5 Dec 2002, Aaron Bannert wrote:Can anyone think of a case where temp files on Unix do not belong in either 1) /tmp or 2) a user-defined location?
I know of a couple of Unix platforms that use /var/tmp, yes. But more
importantly, what makes you think Unix doesn't use environment variables
for locating a temp directory? Try doing a man on tempfile some time. I
quote:
Can a single temp directory be discovered by autoconf at build time and still apply for binary distributions? (Are there platforms where the same binary would work but the default temp dir might change?)
The directory to place the file is searched for in the following order:
a) The directory specified by the environment variable TMPDIR, if it is writable.
b) The directory specified by the --directory argu- ment, if given.
c) The directory /tmp.
This is from the GNU, and as the name implies, GNU's Not Unix. :)
That's Linux, and it is a standard utility to create temporary files. It
is looking for an environment variable first.
Like I said, different Unix platforms have different mechanisms for
locating temporary directories, (although I have never seen one that
didn't use $(TEMP) as a fallback). Leave it up to the platform to locate
temp files if the user doesn't provide one. Don't force the user to jump
through hoops to setup a default, the platform has already done that for
us.
But you just showed an example where it was _not_ $(TEMP) but instead $(TMPDIR). I am asserting that they are not standard nor are they consistent. Though, all of that is irrelevant because allowing environment variables to define program behavior is totally bogus [on systems I care about].
-aaron
