delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/02/26/17:00:42

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Message-ID: <403E69B9.1054A239@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Why can't I use freopen here?
Lines: 18
Date: Thu, 26 Feb 2004 21:49:20 GMT
NNTP-Posting-Host: 12.76.140.13
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1077832160 12.76.140.13 (Thu, 26 Feb 2004 21:49:20 GMT)
NNTP-Posting-Date: Thu, 26 Feb 2004 21:49:20 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

DJGPP 2.03, gcc 3.21.

   if (!(freopen(NULL, "rb", stdin))) {
      puts("Can't open stdin in binary mode");
   }
   else if ...

fails.  The objective is to be able to read past 0x1a EOF markers
in the file.  Line endings are of no concern.  Why does it fail?

Observations: "cat testfile" truncates. "cat testfile >junk" does
not truncate.  "wc testfile" does not truncate.

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!

- Raw text -


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