Article View: comp.std.c
Article #3314Re: binary data with stdin/stdout
From: Norman Diamond
Date: Wed, 27 Jan 1993 01:56
Date: Wed, 27 Jan 1993 01:56
30 lines
2220 bytes
2220 bytes
In article <ig25.728085496@fg70> ig25@fg70.rz.uni-karlsruhe.de (Thomas Koenig) writes: >Does the standard have anything to say about wether stdin and stdout >are opened to a file stream opened in binary mode? Almost. It says that they're text streams. It doesn't require text streams to be different from binary streams, but of course on some implementations they are different. >Would a program which wrote binary data to standard output, or read it >from standard input, be complying? Under the weak definition of "conforming" (for programs) it could very well do so. Under the strong definition of "strictly conforming" it is possible, but you'd have to be very restrictive in the data that you write, and in other operations that you do. I'd have to guess your purpose and guess no. >The reason for asking is that many programs which were developed for >UNIX, which do this, fail on systems where binary and text mode for file >streams are not identical. I'd like to know wether they fail in a >standard - conforming or a non - standard - conforming way :-) If the failure means that the output is different from what the output would be when they succeed, then obviously they're not strictly conforming. (Part of the definition of strictly conforming is that they do not produce output dependent on any unspecified, undefined, or implementation-defined behavior.) -- Norman Diamond diamond@jit.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Pardon me? Or do I have to commit a crime first?
Technical Details
Message-ID:
<1993Jan27.015633.21966@nntpd.lkg.dec.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!bogus.sura.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!engage.pko.dec.com!nntpd.lkg.dec.com!jit345.bad.jit.dec.com!diamondReferences:
<ig25.728085496@fg70>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!darwin.sura.net!bogus.sura.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!engage.pko.dec.com!nntpd.lkg.dec.com!jit345.bad.jit.dec.com!diamond From: diamond@jit345.bad.jit.dec.com (Norman Diamond) Subject: Re: binary data with stdin/stdout Message-ID: <1993Jan27.015633.21966@nntpd.lkg.dec.com> Sender: usenet@nntpd.lkg.dec.com (USENET News System) Reply-To: diamond@jit.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo References: <ig25.728085496@fg70> Date: Wed, 27 Jan 1993 01:56:33 GMT Lines: 30