On Wed, Aug 17, 2005 at 12:22:50PM -0400, Igor Pechtchanski wrote: >On Wed, 17 Aug 2005, Eric Blake wrote: > >> [snip] >> Then you went through the sources, and for all files that manipulate >> human-readable files (such as file name lists, as opposed to actual >> tars), you added FOPEN_TEXT_READ, defined as "rt", to fopen calls, >> and O_TEXT to open calls. All file manipulations that were on binary >> files you left alone. This means that in some cases, your patch to >> 1.13.25 actually created text files (\r\n endings) on a binary mount >> point. > >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. cgf