upload: diffstat-1.40-1, tar-1.15.1-1

Eric Blake ericblake@comcast.net
Thu Aug 18 02:41:00 GMT 2005


> > 
> > But opening with "rt" is non-POSIX,
> 
> No it isn't.  POSIX requires any CRT that doesn't understand or care about
> the second character to ignore it.

This is the POSIX definition of fopen():
http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html

In there, it specifically calls out that "r" and "rb" are synonyms, and
says nothing about ignoring the second character.  Likewise,
"r+", "r+b", and "rb+" ar synonyms, and here b isn't always the
second character.  And it omits any mention of "rt".

On fopen(), cygwin is only compliant with POSIX (ie. "r" and "rb"
behave identically) if you link with binmode.o or if you use a binary
mount point.  Text mount points are the only place where "r" and
"rb" behave differently, since in POSIX, text files and binary files
have no line ending distinction.

--
Eric Blake




More information about the Cygwin-apps mailing list