This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: upload: diffstat-1.40-1, tar-1.15.1-1
- From: ericblake at comcast dot net (Eric Blake)
- To: cygwin-apps at cygwin dot com
- Date: Wed, 17 Aug 2005 16:47:19 +0000
- Subject: Re: upload: diffstat-1.40-1, tar-1.15.1-1
> >
> >I'm not sure this is correct. fopen(..., "rt") should create LF endings
> >on binary mounts and CRLF on text mounts... IIUC, the open mode is a hint
> >to the underlying filesystem whether line ending translation should be
> >done -- the actual translation is done based on the mount type.
>
> Opening with "rt" bypasses the underlying mount type. And, it only
> opens the file for read.
But opening with "rt" is non-POSIX, while opening with "r" or "rb" is
POSIX, so the upstream maintainers are more reluctant to accept
a patch that uses "rt". I have never seen any standards documentation
that describes what "rt" should do, so I assumed that it forced
opening a file in text mode (ie. all \r\n in the file are collapsed to
\n to the application reading the file, regardless of the mount point
of the file). It sounds like you are telling me my assumption was
wrong, and that "rt" on a binary mount point preserves \r?
Maybe we need an update to http://cygwin.com/cygwin-ug-net/using-textbinary.html
--
Eric Blake