Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 88616 invoked by uid 500); 5 Dec 2002 21:36:49 -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 88472 invoked from network); 5 Dec 2002 21:36:47 -0000 Date: Thu, 5 Dec 2002 13:44:12 -0800 (PST) From: X-X-Sender: To: Aaron Bannert cc: Subject: Re: APR_TMP_DIRECTORY In-Reply-To: <8AE6141E-0898-11D7-9902-000393B3C494@clove.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Thu, 5 Dec 2002, Aaron Bannert wrote: > > 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]. Yes, the variables aren't standardized, that is why there is a hierarchy of choices, not a single way to do this. No, using an environment variable to define program behavior is NOT totally bogus. It may be questionable in some instances, but in others it is just fine. The API that is being discussed allows you a simple way to change the directory so that you DON'T have to use environment variables if you don't want to. Aaron, if your argument is that you don't like using env vars, then you don't have an argument here. We aren't forcing you to. There is an API that allows you to specify the directory that you want to use. The other side of the coin is that sometimes it is desirable to use the _system_ temporary directory, which on some platforms is found in and env var, and some platforms have a function to get it. Regardless, we are asking to allow a mechanism for finding the SYSTEM temporary directory. Please, what exactly are you objecting to in the proposed API? AFAICS, your objection has already been handled. Ryan