This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cat and binary files


While I would agree that it would be nice to say that all the GNU tools
are inherently binary, that's not really true.  Many of the tools are
line oriented, and thus require support for detecting a newline; eg.
sed, awk, diff, grep, gcc, gas, etc..

DOS/Windows does not have a "text-mode", it has an ugly newline
standard.  Text-mode was a portability hack introduced into the C
library by Lattice back in the days of DOS 2.0.  Putting CR+LF/LF
translation into read() and write() made it much easier to port C
programs to DOS from elsewhere and vice-versa.  Since then, all
production C compilers have supported an identical or similar feature.

One thing I have never really understood is why so many programs keep
insisting on appending Ctl-Z to files.  There has been no EOF character
in DOS since version 1.0 (and never ever in Windows)!  Ctl-Z == EOF
applies *only* to the con device.  You can test this for yourself with
the DOS copy command.

The other thing I don't understand is this list's seeming indifference
to interoperating with Windows.  If you don't want to play with Windows
files, why aren't you off running Unix?  That's what I do.

BTW, for anyone that's interested, you can fix the Ctl-Z bug by hacking
all support for Ctl-Z out of winsup/fhandler.cc%fhandler_base::read().
It's not hard -- too trivial to post a patch.


- Tim Iverson
  iverson@cisco.com


+----------------
| Date: Thu, 10 Apr 1997 18:42:19 -0400
| To: Tim Iverson <iverson@cisco.com>, huott@pinebush.com (Ed Huott)
| From: "Larry Hall (RFK Partners Inc 617-239-1053)" <lhall@rfk.com>
| Subject: Re: cat and binary files
| Cc: marc@watson.ibm.com, gnu-win32@cygnus.com
| 
| At 07:38 PM 4/9/97 -0700, Tim Iverson wrote:
| >All this aside, IMHO, cat is inherently a binary program -- it shouldn't
| 
| I would submit that you can extend your binary program argument further
| to encompass all the GNU tools.  Certainly they were initially designed for
...
| don't want to open up an argument on how these tools should work in a 
| DOS based environment but I would like to point out that using them on 
| "text" files is basically an unsupported configuration.  While it would be
...
| offending file through some filter.  Other than this "inter-operability"
| with DOS/Windows-based programs issue, I've seen no deleterious effects 
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]