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:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Reply via email to