Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #297

Re: How to dup a FILE*

From Josef Moellers <josef.moellers@ts.fujitsu.com>
Newsgroups comp.os.linux.development.apps
Subject Re: How to dup a FILE*
Date 2011-12-06 16:57 +0100
Organization Fujitsu Technology Solutions
Message-ID <jble0e$afq$1@nntp.ts.fujitsu.com> (permalink)
References <jbkl2v$a75$1@nntp.ts.fujitsu.com> <jbl59m$upm$1@reversiblemaps.ath.cx>

Show all headers | View raw


Am 6.12.2011 schrub Jasen Betts:

> On 2011-12-06, Josef Moellers <josef.moellers@ts.fujitsu.com> wrote:
> 
>> fflush(stderr);
>> fclose(stderr);
> 
>> dup2(oldfd2, fileno(stderr));	/* this may not work, see below */
> 
> read the man page for fclose: you can't do anything (useful) with stderr after
> fclose(stderr).
> 
That's what I tought, hence my remark.

I have now implemented Richard's idea, as I understood it (just change
fd2 underneth stderr).

Josef
-- 
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to dup a FILE* Josef Moellers <josef.moellers@ts.fujitsu.com> - 2011-12-06 09:51 +0100
  Re: How to dup a FILE* Richard Kettlewell <rjk@greenend.org.uk> - 2011-12-06 09:16 +0000
    Re: How to dup a FILE* Josef Moellers <josef.moellers@ts.fujitsu.com> - 2011-12-06 10:41 +0100
  Re: How to dup a FILE* Jasen Betts <jasen@xnet.co.nz> - 2011-12-06 13:28 +0000
    Re: How to dup a FILE* Josef Moellers <josef.moellers@ts.fujitsu.com> - 2011-12-06 16:57 +0100
  Re: How to dup a FILE* David W Noon <dwnoon@spamtrap.ntlworld.com> - 2011-12-06 19:53 +0000
    Re: How to dup a FILE* Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-12-06 20:38 +0000
      Re: How to dup a FILE* Richard Kettlewell <rjk@greenend.org.uk> - 2011-12-06 22:03 +0000
      Re: How to dup a FILE* David W Noon <dwnoon@spamtrap.ntlworld.com> - 2011-12-06 21:46 +0000
        Re: How to dup a FILE* Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-12-07 17:52 +0000

csiph-web