Mail Archives: djgpp/1999/03/26/12:35:31
-----Original Message-----
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: Wednesday, March 24, 1999 11:33 PM
Subject: Re: libc bug?
>In article <01be764f$7b2ea120$LocalHost AT thendren> you wrote:
>[...]
>> part of the code requires me to create temporary files and write some
>> compressed information into that file. since libc has a tmpfile()
function,
>> is used that. however, when i write compressed information to the file
and
>> then retrieve it, it does not come back the same.
>
>This is most probably due to the fact that (your version of) tmpfile()
>opens the file in text, not in binary mode. Either explicitly set it
>to binary post hoc, using the 'setmode(fileno(file), O_BINARY)'
>method, or use tmpnam()/fopen() instead of tmpfile().
opens in text? doesn't that kind of negate the effects of a temporary file?
if you want to leave text for some reason, you're not going to use a
temporary file, you're going to open a real file. the whole point of a
temporary file is to save binary information for a moment. any idea WHY
this particular design decision was taken? or did they just open the file
in default mode just 'cause?
-={C}=-
- Raw text -