Subject: Re: using cat on binary files (CTRL-Z trauma)
From: [email-masked] (DJ Delorie)

29 Oct 1996 06:16:04 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-CC: [email-masked], [email-masked]
In-reply-to: <[email-masked]> ([email-masked])
Original-Sender: [email-masked]

> Many UNIX programs don't specify WHAT???  O_BINARY is strictly a 
> MS-DOS artifact.  Well, maybe Mac's have it, I don't know.  There 
> _is_ no O_BINARY flag in UNIX, so I would hazard to guess that there 
> are _very_ few UNIX programs that use it.

It's easy to add to the beginning of a unix program:

	#ifndef O_BINARY
	#define O_BINARY 0
	#endif

> I would suggest that for maximum compatibility files should default 
> to binary mode.

We've had this discussion on the djgpp group many times.  For some
programs, it makes sense, but we almost always end up adding a
command-line option to change the default.

If cat were binary, and you cat'd two files with ^Z in them, when you
read the file with another program, it stops at the first ^Z and you
don't see the second file at all.
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".