From: franl AT world DOT std DOT com (Francis Litterio) Subject: Re: ASCII and BINARY files. Why? 31 Jan 1997 20:54:41 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: References: <01BC0F52 DOT 60E6BAC0 AT Pentium> X-Newsreader: Forte Free Agent 1.0.82 Original-To: gnu-win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com Michael Paul Smith 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: franl AT world DOT std DOT com 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 "gnu-win32-request AT cygnus DOT com" with one line of text: "help".