Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!gwyn@brl-vld From: gwyn%brl-vld@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Re: fdopen() problem in stdio Message-ID: <13387@sri-arpa.UUCP> Date: Sun, 6-Nov-83 14:39:41 EST Article-I.D.: sri-arpa.13387 Posted: Sun Nov 6 14:39:41 1983 Date-Received: Tue, 8-Nov-83 21:06:07 EST Lines: 9 From: Doug Gwyn (VLD/VMB) There is no direct way to free a FILE pointer without closing the file descriptor. However, if you dup() (or fcntl()) the descriptor first, then the "close" will amount to a no-op insofar as its effects on the inode attached to the file descriptor are concerned. You can fclose() the stream, dup() the duplicate fd back to its original value, then close out the duplicate file descriptor and proceed to fdopen() as before.