Date: Thu, 25 Mar 1999 16:37:25 +0100 From: Hans-Bernhard Broeker Message-Id: <199903251537.QAA16506@acp3bf.physik.rwth-aachen.de> To: djgpp AT delorie DOT com Subject: Re: libc bug? Newsgroups: comp.os.msdos.djgpp Organization: RWTH Aachen, III. physikalisches Institut B X-Newsreader: TIN [version 1.2 PL2] Reply-To: djgpp AT delorie DOT com 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(). Wether or not this has changed in newer version of DJGPP's libc is unkown to me, at the moment. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.