Article View: comp.std.c
Article #4770Re: Binary Mode stdin/stdout
From: Markus Kuhn
Date: Thu, 08 Feb 1996 01:39
Date: Thu, 08 Feb 1996 01:39
27 lines
1789 bytes
1789 bytes
clive@stdc.demon.co.uk (Clive D.W. Feather) writes: >In article <4f67kg$11g@cortex.dialin.rrze.uni-erlangen.de>, >Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de> wrote: >> Why isn't there a standard way of allowing an ISO C program to switch >> the standard input and output into binary transparent mode (as with >> the "b" flag in fopen()/freopen() for normal files)? >> >> Has this just been forgotten or is there a good technical reason? >On some implementations, this decision has to be made at the time you >open the file and can't be changed. I would already be happy with a portable function that allows to switch stdin or stdout to binary mode and that has only a well-defined behaviour according to the standard if this switch occurs before any byte has been written to or read from the stream. This would cause no headaches on your computing fossil (because inserting a newline during a later switch would not be non-conforming) and would be sufficient for all important applications I can think of (like zcat). Markus -- Markus Kuhn, Computer Science student -- University of Erlangen, Internet Mail: <mskuhn@cip.informatik.uni-erlangen.de> - Germany WWW Home: <http://wwwcip.informatik.uni-erlangen.de/user/mskuhn>
Technical Details
Message-ID:
<4fbk81$qk@cortex.dialin.rrze.uni-erlangen.de>Path:
arc1-ca.pugleaf.net!unrza3.dialin.rrze.uni-erlangen.de!not-for-mailReferences:
<4f67kg$11g@cortex.dialin.rrze.uni-erlangen.de> <DME74w.4M4@stdc.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!unrza3.dialin.rrze.uni-erlangen.de!not-for-mail From: mskuhn@unrza3.dialin.rrze.uni-erlangen.de (Markus Kuhn) Newsgroups: comp.std.c Subject: Re: Binary Mode stdin/stdout Date: 8 Feb 1996 02:39:13 +0100 Organization: Markus Kuhn, 91080 Uttenreuth, Germany Message-ID: <4fbk81$qk@cortex.dialin.rrze.uni-erlangen.de> References: <4f67kg$11g@cortex.dialin.rrze.uni-erlangen.de> <DME74w.4M4@stdc.demon.co.uk> Reply-To: mskuhn@cip.informatik.uni-erlangen.de NNTP-Posting-Host: unrza3.dialin.rrze.uni-erlangen.de