Redirection of stderr
Chris Torek
torek at elf.ee.lbl.gov
Wed Mar 20 06:40:42 AEST 1991
In article <524 at 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 at ee.lbl.gov
More information about the Comp.unix.wizards
mailing list