This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]