upload: diffstat-1.40-1, tar-1.15.1-1
Wed Aug 17 17:16:00 GMT 2005
On Wed, Aug 17, 2005 at 04:47:19PM +0000, Eric Blake wrote:
>>>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,
I don't see what that has to do with anything.
>It sounds like you are telling me my assumption was wrong, and that
>"rt" on a binary mount point preserves \r?
I said that using "rt" bypasses the underlying mount type. Your
conclusion from that is that specifying "rt" on a binary mount uses the
mount type. I really don't see how you could draw this conclusion.
Specifying an option to fopen or open gives you what the option
specifies. If you use "rt", CRLF will be translated to LF on read. If
you use "wt", LF will be translated to CRLF. The mount mode doesn't
enter into calculation if the program specifies the kind of translation
it wants via O_TEXT, O_BINARY, "b", or "t".
More information about the Cygwin-apps