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

31 Jan 1997 20:54:41 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <01BC0F52.60E6BAC0@Pentium>
X-Newsreader: Forte Free Agent 1.0.82
Original-To: [email-masked]
Original-Sender: [email-masked]

Michael Paul Smith <[email-masked]> wrote:

> The ASCII or BINARY thing is no big deal in practice.

Then you've probably never done any of these things under UNIX:

1.  Used cat to aggregate a partitioned gzip file:

	cat file.gz.1 file.gz.2 file.gz.3 | gunzip -c > file

2.  Used sed to change the names of symbols in an object file:

	sed 's;read;rEaD;g' < foo.o > newfoo.o

3.  Or even just tried to see a hex or octal dump of what's
    in a file that doesn't contain text:

	od foo.gz

None of these commands work correctly given the default configuration
of the gnu-win32 system (i.e., not mounting with the -b switch).  #1
fails for two different reasons: cat will stop reading when it sees a
^Z in any of the files, and (if you're lucky enough to avoid that),
gunzip see CRNL converted to NL in the byte stream.

It is even possible (under the current defaults) for the following two
commands to work differently:

	zcat foo.gz		# Works.
	zcat < foo.gz		# Fails with CRC error

If none of this bothers you, then fine, but many UNIX software
engineers find it unacceptable for a UNIX emulation package to have a
read() call that (by default) converts CRNL to NL, leaving it up to
the application to do a "binary open" (a meaningless concept under
UNIX) to get the right behavior.

> I 
> have ported many Unix programs to DOS and Win95 and usually this is fixed 
> by greping for fopen() and open() and making the required mods.

Editting the source is explicitly a non-goal of the gnu-win32 project.

> Most Unix software which handles text can be made compatible with DOS,
> Win95, WinNT and Unix in very little time this way

"Very little time" multiplied by hundreds and thousands of
applications ends up being a large amount of time.
--
Francis Litterio                     PGP Key Fingerprint:
[email-masked]                  02 37 DF 6C 66 43 CD 2C
http://world.std.com/~franl/         10 C8 B5 8B 57 34 F3 21

-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".