Subject: Re: ASCII and BINARY files. Why?
From: [email-masked] (Fergus Henderson)

2 Feb 1997 06:59:48 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (Barry Fishman)
Original-Cc: [email-masked] (gnu-win32)
In-Reply-To: <[email-masked]> from "Barry Fishman" at Jan 30, 97 07:37:46 pm
X-Mailer: ELM [version 2.4 PL24]
Original-Sender: [email-masked]

Barry Fishman wrote:
> 
> Now back to the ASCII/BINARY discussion.  I think we need to follow
> the principle of least astonishment.  When one opens a file and
> sees ^M 's at the end of each line, you can tell right away what is
> going on.

You may be able to tell, but software can't.

Consider, for example, the surprise you get when doing a `diff' on a
gnu-win32 file after you've changed one line using a Windows editor.

Consider, for example the suprises that this sort of problem will
lead to when using tools like CVS.

> What is difficult is having to spend hours patching each application to
> to get around unexpected problems with seek addresses and files that
> don't match their expected sizes.

That is indeed difficult, but you must bear in mind that *whichever*
approach we adopt, there will probably be some difficulties.  We're
just trying to find the minimum-difficulty approach.  A zero-difficulty
solution seems impossible.

Not every application relies on file sizes or seek offsets being
related to number of characters read.  Most of those that do rely on
this do it only for binary files, and so patching them is a simple
matter of changing the calls to `fopen' or `open' to open the file
in binary mode.

The only ones that cause significant difficulty are those applications
that rely on file sizes or seek offsets being related to number of
characters read *for text files* (e.g. ~/.bash_history).
I don't think there are many such applications, are there?

-- 
Fergus Henderson <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".