On Wed, 4 Dec 2002, David Reid wrote:
> If we don't have such a declare maybe we should add one? I say this as > htpasswd.c (in httpd) uses P_tmpdir that isn't portable and breaks the beos > build. Also Thom found a note in his stdio.h file saying that it wasn't the > right way to do things, and I agree it's not. > > I propose that it would simply take the form of a define > > #define APR_TMP_DIRECTORY "/var/tmp" > > and can be set by platform. > > Thoughts? 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: 1) P_TMPDIR 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. Ryan
