mkstemp vs. text mode

Eric Blake ebb9@byu.net
Mon Apr 17 12:18:00 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Should we change mkstemp to always open in binary mode, regardless of the
mount mode of the directory of the template name?  Arguments for this is
that mkstemp is often used by programs for binary data, where a text-mode
/tmp mount point would corrupt that data if we defer to the mount point.
Also, a temp file is an intermediate data storage location, similar to
pipes, and we currently treat pipes as binary by default; a program
copying data to a temp file, then from there to a final destination, only
needs text mode on the final destination.  Programs that really want a
text-mode temp file can do setmode after the fact, but this is probably
less common.

This should still be a trivial patch.  Meanwhile, I will start the process
of getting an employee disclaimer for Red Hat (it took me almost a year to
get one signed for FSF).

2006-04-17  Eric Blake  <ebb9@byu.net>

	* mktemp.cc (_gettemp): Open temp files in binary mode.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEQ4ee84KuGfSFAYARAkpIAKCYK1IRVHZ4dMkWUTgyzycxyMkBawCfXgz4
wCvt41FDUXLB67JFnv+vZgg=
=LLV/
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch1
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20060417/e06dfe1c/attachment.ksh>


More information about the Cygwin-patches mailing list