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

From: Paolo Bonzini <[email-masked]>
Date: Sat, 17 Jul 2010 08:13:59 +0200

On 07/16/2010 11:47 PM, Paul Eggert wrote:
> 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.

No idea.  I just thought a heads-up was in order...

Paolo