lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: freopen -- the easy way (was: Re: LYNX-DEV 4DOS)


From: Larry W. Virden, x2487
Subject: Re: freopen -- the easy way (was: Re: LYNX-DEV 4DOS)
Date: Thu, 8 May 1997 10:23:47 -0400

To handle the case of the freopen failing, you might be able to use
something like
int oldstderrfd;
FILE *newstderr;

if ((oldstderrfd = dup(fileno(stderr))) != -1 ) {
        /* Do your code to do the freopen of stderr, etc.) */
}

/* Now, when it's time to go back ... */
if ( (stderr = fdopen(oldstderr,"w+") ) != NULL ) {
        /* stderr should be back to where it was */
}

-- 
Larry W. Virden                 INET: address@hidden
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should 
be construed as representing my employer's opinions.
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]