Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 78883 invoked by uid 500); 5 Dec 2002 21:29:34 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 78858 invoked from network); 5 Dec 2002 21:29:33 -0000 Date: Thu, 5 Dec 2002 13:28:48 -0800 Subject: Re: APR_TMP_DIRECTORY Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v548) From: Aaron Bannert To: dev@apr.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: <8AE6141E-0898-11D7-9902-000393B3C494@clove.org> X-Mailer: Apple Mail (2.548) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Thursday, December 5, 2002, at 01:26 PM, 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