www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/27/13:58:12

Date: Thu, 27 Aug 1998 13:07:12 +0200
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Message-Id: <199808271107.NAA26245@acp3bf.physik.rwth-aachen.de>
To: dejatv AT my-dejanews DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: how to write binary files to stdout?
Newsgroups: comp.os.msdos.djgpp
Organization: RWTH Aachen, III. physikalisches Institut B

In article <6s2lob$4cr$1 AT nnrp1 DOT dejanews DOT com> you wrote:


> Is it possible to change the mode of stdout to binary?  I've tried

>     setmode(stdout, O_BINARY);

The trick is setmode needs a file *handle*, not a 'FILE*', as its
first argument. 'stdout' is a 'FILE*' variable, though. You should be
doing something like this:

	setmode(fileno(stdout), O_BINARY);

(and #include the necessary header files, of course).


--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019