www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/09/07:00:41

Date: Wed, 9 Apr 1997 13:34:06 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "John M. Aldrich" <fighteer AT cs DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: read reads too less under DOS but enough under linux
In-Reply-To: <334A8639.6204@cs.com>
Message-ID: <Pine.SUN.3.91.970409133128.3639Q-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019