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 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 Precedence: bulk > 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.