delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/09/16/05:26:21

Date: Wed, 16 Sep 1998 12:26:15 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: auto-binary-mode?
In-Reply-To: <199809152120.RAA08510@delorie.com>
Message-ID: <Pine.SUN.3.91.980916122555.5874U-100000@is>
MIME-Version: 1.0

On Tue, 15 Sep 1998, DJ Delorie wrote:

> Hey, I just had an idea.  When a file is opened and the first block is
> read in, if the user didn't specify binary or text, why not look at
> the data and try to guess?  The presence of null, control, or certain
> 8-bit characters should indicate binary vs text as a default.

Null character is the only one which can be reliably used for such a
guesswork.  Anything else can appear e.g. in a C source or in an Info
file, and could totally screw programs, like the compiler, which
depend on lines ending with a single newline.  The DJGPP port of GNU
Grep originally used characters other than null, but that caused it to
decide incorrectly in some cases.

If this is meant to solve the problem of reading real binary files,
like program executables, then such a feature might be useful, albeit
in a small number of cases.

But it will not solve the problem of those who need to read text files
past the ^Z and other atrocities.

- Raw text -


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