This is the mail archive of the
mailing list for the Cygwin project.
Re: mkstemp vs. text mode
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 17 Apr 2006 11:10:18 -0400
- Subject: Re: mkstemp vs. text mode
- References: <4443879E.firstname.lastname@example.org>
- Reply-to: cygwin-patches at cygwin dot com
On Mon, Apr 17, 2006 at 06:18:38AM -0600, Eric Blake wrote:
>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 <email@example.com>
> * mktemp.cc (_gettemp): Open temp files in binary mode.
Yes, I think it makes sense to open temp files in binary but I'll bet
that someone is relying on textmode behavior. Nevertheless, I've
applied the patch.
Let the cygwin ML whines begin...