apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <aa...@clove.org>
Date Thu, 05 Dec 2002 17:20:04 GMT

On Wednesday, December 4, 2002, at 10:50  AM, <rbb@apache.org> wrote:
> On Wed, 4 Dec 2002, David Reid wrote:
>> I propose that it would simply take the form of a define
>> #define APR_TMP_DIRECTORY "/var/tmp"
> Haven't we discussed this before?  I thought we had, and we had 
> decided to
> come up with a hierarchy of ways to find the temp directory.  
> Basically,
> just have a function  apr_get_temp_dir(), which tried various options
> until it found one that worked.  (Where worked is defined as the 
> directory
> exists).
> The list of options was something like:
> 2) env variable TEMP
> 3) env variable TMPDIR
> 4) env variable TEMPDIR
> 5) hard-coded /tmp  (guaranteed to work, regardless of whether the dir
> exists).
> Obviously, platforms that have a well-known temp directory could 
> implement
> their own apr_get_temp_dir to just return the correct string, but for
> Unix platforms, there are three or four "correct" temp locations based 
> on
> platform and how the admin has things setup.

I don't like the idea of having environment variables drive things like 
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 
and then retrieved later by apr_get_temp_dir(). The nice thing about 
is it doesn't incur any processing overhead when apr_get_temp_dir() is 
and can let apps like httpd create their own config directive for 
setting the
preferred tempdir.


View raw message