apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@collab.net
Date Fri, 06 Dec 2002 08:48:17 GMT
Dirk-Willem van Gulik <dirkx@webweaving.org> writes:

> 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's the hangup here?  Every Unix I've ever seen, and every Windows
version I've ever seen, has a notion of a temporary directory.  I'd be
shocked if BeOS and Netware don't also have something similar.  The
annoyance is that you get at them in different ways on different OSes.
Is that not *the very problem* APR exists to solve?  

I can't imagine that the OSes just provide these temp directories for
kicks -- it would seem that the very designers of the OSes felt they
were necessary for *something*.

Nobody is asking for APR to do anything other than solidify the
existent per-OS algorithms for figuring out a good temp directory into
a single interface that looks the same on all platforms despite the
gunk that happens behind-the-scenes.  If APR doesn't provide this,
every program that finds such a directory necessary -- for whatever
reason -- will have to implement these same algorithms.  And that's
just ridiculous.  It's not like APR's failure to provide the
functionality means it doesn't exist; it's not like APR is going to
actually *open* a previously nonexistent security hole.

View raw message