delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2010/08/13/07:15:20

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: Re: resetting stdin after redirection
Date: Fri, 13 Aug 2010 07:02:19 -0400
Organization: Aioe.org NNTP Server
Lines: 27
Message-ID: <i438mq$1r0$1@speranza.aioe.org>
References: <i3vv7d$nsg$1 AT speranza DOT aioe DOT org> <4c6387a2$1 AT news DOT x-privat DOT 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: 1626
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Jason Hood" <jadoxa AT yahoo DOT com DOT au> wrote in message
news:4c6387a2$1 AT news DOT x-privat DOT org...
> On 12/08/2010 15:02, Rod Pemberton wrote:
> > 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
>
> freopen( "con", "r", stdin );
>
> should do the trick.
>

Comes close...  That does reassociate stdin.  But, it didn't fix all of my
issues...  It seems stdout must be "fixed" also:

  setbuf(stdout,NULL);

I also found out that:
  freopen() doesn't like "CON" in capitals...
  freopen() doesn't like "rb" for the mode... -locks up v2.03- only "r" and
"rt" work.

Thanks,


Rod Pemberton


- Raw text -


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