Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!hellgate.utah.edu!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Redirection of stderr Message-ID: <11127@dog.ee.lbl.gov> Date: 19 Mar 91 20:40:42 GMT References: <574@dprmpt.UUCP> <521@bria> <524@bria> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Distribution: na Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 12 X-Local-Date: Tue, 19 Mar 91 12:40:42 PST In article <524@bria> uunet!bria!mike writes: >#define fdup2(A,B) (memcpy(B,A,sizeof(FILE))) /* UGLY */ Not only that, it does not work---because there is no guarantee that a FILE object holds the state. In particular, in some System V stdio's, one or more of the fields in a FILE object is an index into a completely separate object. To duplicate the state of one FILE, you must copy not only that one FILE object but also any objects to which it points, and there is no way to find those (unless you write your own stdio). -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov