Mail Archives: djgpp/1997/04/09/07:00:41
On Tue, 8 Apr 1997, John M. Aldrich wrote:
> DOS text files use a CR/LF combination to designate the end of a line,
> while Unix text files use only a CR. Thus, DOS text files are larger
> than the corresponding Unix file. For this reason, you should NEVER
> open a text file in binary mode.
That would be swell, but the problem is that you don't always know whether
the file is a text or a binary one. For that reason, sometimes you have
no alternative but to open it in binary mode and add special tests for the
CR-LF pairs. For examples, see the DJGPP ports of Grep and Textutils.
- Raw text -