Sender: crough45 AT amc DOT de Message-Id: <97May31.163143gmt+0100.16641@internet01.amc.de> Date: Sat, 31 May 1997 15:35:39 +0100 From: Chris Croughton Mime-Version: 1.0 To: ILGES AT cc DOT uab DOT es Cc: djgpp AT delorie DOT com Subject: Re: tmpfile() and binary mode in DJGPP Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk >We have "discovered" that tmpfile() opens the temporay file in >the mode (binary or text) resulting from : > _fmode & O_TEXT >As the usual mode is text, the temporary file is created in text mode. See bug report 000143, which reports the bug, has a workaround (not portable, but sufficient if you're only using DJGPP and not bothered about porting to Unix) and has the patch for the library sources. >If you, DJGPP gurus, do not agree with us (and with our colleagues >that love a lot the DJ compiler, but that have wasted a lot of time >trying to understand a problem derived from this "characteristic" >of the tmpfile() function), at least, please include this asymmetry >on the FAQ. It has been acknowledged by at least one 'guru' (not me!) that it is a bug, and a fairly serious one since it breaks conformity with the ANSI standard. In the meantime, check out the bug tracking system for DJGPP (http://www.delorie.com/djgpp/bugs/list-open.cgi) and apply the fixes. Incidentally, there's no need to recompile the whole library. Just get the sources, patch the file, compile that file and use 'ar' to put the new object into the library. Thanks for your efforts, it's only by reporting things like this that they get fixed... Chris