You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Stas Bekman <st...@stason.org> on 2001/12/06 16:36:16 UTC

about usefulness of apr_file_mktemp

I've looked at apr_file_mktemp (need it for mod_perl 2.0). I guess I 
don't understand something. Why the developer is supposed to do the work 
of mktemp? It wants to receive a path-template, but how am I supposed to 
know what path will work across platforms? e.g. /tmp is not available on 
all platforms and writing into the current directory is not an option. I 
don't know much about non-Unix OSs, not talking about differences in 
Unix tmp filesystems.

I want a pure tmpfile() function which figures out where to create the 
file and what names it wants it to give, where I don't have to think 
about portability issues.

POSIX defines these two function:
   char *tmpnam(char *s);
   FILE *tmpfile (void);
that do what I want.

I know that POSIX is not available everywhere, but that doesn't help to 
improve the portability of the code using APR.

I think at least things would be easier if there was apr_tmp_dir() 
(which returns the existing temp dir) which then could be used to create 
a template wanted by apr_file_mktemp.

Thanks!

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/