Mail Archives: djgpp-workers/1998/09/16/05:26:21
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 -