-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Eric Blake wrote:
> John Cowan <cowan <at> ccil.org> writes:
> 
>> Are you saying that an O_TEXT open under Cygwin, given a binary mount,
>> will cause newline translation?  I had assumed that O_TEXT would be
>> ignored under Cygwin just as it is under Linux.
> 
> Yes.  The cygwin behavior is as follows:
> 
> open(O_RDONLY), fopen("r") - open the file using the mount point rules to 
> decide whether the file is text or binary
> 
> open(O_RDONLY|O_TEXT), fopen("rt") - open the file forced in text, regardless 
> of mount point

<snip>

> Using O_BINARY is important, however, I claim that using O_TEXT in portable 
> code should be a very rare circumstance.  There's a reason that C99 only 
> calls 
> out fopen("r") and fopen("rb"), but not fopen("rt").

The reason C99 uses "r" and not "rt", is that, unless "b" is specified,
it is _always_ supposed to be opened in text-mode. Thus, having a "t" is
redundant, and treating it as different from "r" is broken from the
stadnard's POV, AFAICT.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG4DcX7M8hyUobTrERCKk9AJ0dmBYQc9mvmruB+ycXS0ARw1tiYQCePjfz
qMAYAM2vnWpcFyGDuVW+Er0=
=ocRY
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to