Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 60110 invoked by uid 500); 6 Dec 2002 15:52:05 -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 60096 invoked from network); 6 Dec 2002 15:52:04 -0000 Date: Fri, 6 Dec 2002 07:59:21 -0800 (PST) From: X-X-Sender: To: Dirk-Willem van Gulik cc: Aaron Bannert , APR Dev List Subject: Re: APR_TMP_DIRECTORY In-Reply-To: <20021206092859.X64105-100000@foem.leiden.webweaving.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 Fri, 6 Dec 2002, Dirk-Willem van Gulik wrote: > On Thu, 5 Dec 2002, Aaron Bannert wrote: > > > I don't like the idea of having environment variables drive things like > > this. Temp directories are a great way to get programs to write files > > wherever you want. I'd much rather have a function where the global > > tempdir can be set and then retrieved later by apr_get_temp_dir(). The > > nice thing about this is it doesn't incur any processing overhead when > > apr_get_temp_dir() is called, and can let apps like httpd create their > > own config directive for setting the preferred tempdir. > > Over the years the same discussion has been had in various unix forums - > and I have a strong feeling that the consensus reached there (or at least > the working assumption) that the ability to get a 'free to use' directory > reference was BAD - and that you are better off asking for a temp file > name; as to avoid clashes and all sorts of other mayem. > > What is the reason we MUST have a tempdir getter ? Just because there is > one on windows ? Is it really not enough to just do tempfile() getting ? > > It just feels like an operational rat hole (think for example a secure > unix) We already have a tempfile()-like API. People have asked for a way to get the file name for a unique file. We are providing an API that does this. However, you must have a place to put a temporary file, and each platform has a different location for such files. Unless you can think of another way to get a temp file name without using the systems temp directory, we have no other option. Forcing the app programmer to give us a path is a non-starter, because it means that the temp files will essentially never be in the correct location. Ryan