The way how gen_tempname() creates files is not always sufficient. For example,
it may make sense to create directories when creating the temporary file or
directory fails with errno set to ENOENT. Add a try_tempname() variant of
gen-tempname() that allows to do all that, and implement gen_tempnam
Andreas Grünbacher wrote:
Well, try_file() passes the flags on to open() for gen_tempfile's
GT_FILE mode.
Ah, sorry, I missed that.
For some uses (like mine), a create mode parameter wouldn't hurt, either.
Then I suggest just passing a generic (void const *) argument to the TRY
function.
2015-01-31 23:20 GMT+01:00 Paul Eggert :
> Thanks for this improvement. However, I don't see why the new
> __gen_tempname needs a FLAGS argument, as the new little functions now take
> care of the flags.
Well, try_file() passes the flags on to open() for gen_tempfile's
GT_FILE mode. I don't think
Thanks for this improvement. However, I don't see why the new __gen_tempname
needs a FLAGS argument, as the new little functions now take care of the flags.
> From: Daiki Ueno
> Cc: gavinsmith0...@gmail.com, bug-gnulib@gnu.org
> Date: Sun, 01 Feb 2015 03:52:20 +0900
>
> Eli Zaretskii writes:
>
> > Thanks. This improves things, but unfortunately not enough. The
> > reason is that call to setlocale at the beginning of locale_charset,
> > which is
Eli Zaretskii writes:
> Thanks. This improves things, but unfortunately not enough. The
> reason is that call to setlocale at the beginning of locale_charset,
> which is always made. If I replace that call with a constant string,
> I get a 20-fold speedup, and the display of large nodes in the
The way how gen_tempname() creates files is not always sufficient. For example,
it may make sense to create directories when creating the temporary file or
directory fails with errno set to ENOENT. Add a try_tempname() variant of
gen-tempname() that allows to do all that and implement gen_tempname
> From: Daiki Ueno
> Cc: Eli Zaretskii , bug-gnulib@gnu.org
> Date: Tue, 27 Jan 2015 15:14:36 +0900
>
> I took a bit more serious attempt to this, and ended up with the
> attached patch. Using the following test program:
>
> #include "config.h"
> #include "localcharset.h"
> #include
>
>