Eric Blake <[EMAIL PROTECTED]> writes:

> Should we replace all uses of "creat (name, mode)" (such as in
> creat-safer.c) with "open (name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
> mode)", with O_BINARY properly defined to 0 on POSIX systems?

That might make sense for some instances of creat, but not the
instance in creat-safer.c.  POSIX says creat is equivalent to open
with O_WRONLY|O_CREAT|O_TRUNC, and my kneejerk reaction is that I'd
rather not second-guess this, even on Cygwin.

> Or should we just encourage GNU programs to use open instead of creat, so
> that they have explicit control over whether the O_BINARY flag is used,
> resulting in one less portability gotcha.

I would say that we should encourage the use of open over creat only
when it matters.  For tar, I guess it matters, since tar files are
inherently binary.  For other files it might not matter.

> Hmm, maybe something similar should be done for the recently removed
> asctime_r and ctime_r.

I suppose we could have a time-safer module, but is it really worth
the trouble?  Anybody who's likely to use it will already have swept
for ctime (which is by far the biggest problem), as well as for
asctime, ctime_r, and asctime_r.


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to