delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2010/08/12/01:15:22

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT notreplytome DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: resetting stdin after redirection
Date: Thu, 12 Aug 2010 01:02:05 -0400
Organization: Aioe.org NNTP Server
Lines: 21
Message-ID: <i3vv7d$nsg$1@speranza.aioe.org>
NNTP-Posting-Host: pldq+kT97bAAp/ObDwnZyQ.user.speranza.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Microsoft Outlook Express 6.00.2800.2001
X-Priority: 3
X-MSMail-Priority: Normal
Bytes: 1422
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I need to use DOS command-line redirection to input data from a file to my
program.  Once the file has been read in, I then need more input - from the
keyboard or console.  The problem is that stdin is still redirected to
accept input from the input file - even though it's reached it's EOF.  It
doesn't automatically fallback to the default keyboard or console input.
After redirection, is there a DJGPP way to reassociate stdin with the
keyboard or console? as if, stdin had not been redirected? Can stdin be
reset somehow?

fclose on stdin?
something with freopen?
hidden feature?
anything?


Rod Pemberton
PS.  I'm not interested in comments telling me to pass the file as argv...
Thanks.


- Raw text -


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