apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject what's the portable temp dir?
Date Wed, 17 Apr 2002 09:37:14 GMT
Any chance APR will handle a portable apr_get_temp_dir function? (which 
returns the existing writable temp path) which then could be used to 
create a template wanted by apr_file_mktemp().

e.g. perl's CGI.pm which is used on many platforms uses this hardcoded 
array where it then searches for the first writable directory (at 
compile time)

$SL = $CGI::SL;
my ($vol) = $MAC ? MacPerl::Volumes() =~ /:(.*)/ : "";
	   "${vol}${SL}Temporary Items",
            "${SL}WWW_ROOT", "${SL}SYS\$SCRATCH",
     unshift(@TEMP,$ENV{'TMPDIR'}) if exists $ENV{'TMPDIR'};

of course if we can use existing library functions that would be more 
portable I think.

POSIX systems has tmpnam().
BSD 4.3 has tempnam().
That's all I know.

Can we re-use such a function from another project that runs on many 
platforms? NSPR comes to mind. http://www.mozilla.org/projects/nspr/

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

View raw message