delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/02/26/20:10:59

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Thu, 26 Feb 2004 20:09:45 -0500
Message-Id: <200402270109.i1R19jZN010621@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <403E69B9.1054A239@yahoo.com> (message from CBFalconer on Thu, 26
Feb 2004 21:49:20 GMT)
Subject: Re: Why can't I use freopen here?
References: <403E69B9 DOT 1054A239 AT yahoo DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

>    if (!(freopen(NULL, "rb", stdin))) {

> 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?

It fails because the path you specified is NULL.  That is not legal.

Use setmode(0, O_BINARY) to change stdin to binary.

But please read the info page on setmode() before using it.

- Raw text -


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