Subject: Re: bug#6657: mkstemp on cygwin creates binary files

From: Paul Eggert <[email-masked]>
Date: Fri, 16 Jul 2010 14:47:15 -0700

On 07/16/10 13:27, Paolo Bonzini wrote:

> I fixed it by using instead mkostemp(template, 0).  From a quick "git
> grep", it seems like sort and tac are affected by the bug in coreutils.

tac access the temp file in binary mode, so there's no problem there.

I don't see the problem with 'sort' offhand.  Why would the user care whether
line endings in sort's temp files are \r\n or \n?  Using binary mode is a
bit faster and more reliable, surely.

Or is there some problem if the file descriptor is created with O_BINARY
and then fdopen is called with "w" (and not "wb")?  I guess "sort" does
that on Cygwin now.