Date: Wed, 16 Sep 1998 12:26:15 +0300 (IDT) From: Eli Zaretskii To: DJ Delorie cc: djgpp-workers AT delorie DOT com Subject: Re: auto-binary-mode? In-Reply-To: <199809152120.RAA08510@delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.