Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: how can I get filename from file descriptor? Message-ID: <2384@auspex.auspex.com> Date: 24 Aug 89 19:34:09 GMT References: <19208@mimsy.UUCP> <1586@cbnewsl.ATT.COM> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 12 >You also need to take into account actions on the fd itself, such as >unlink(fileno(fd)). No, you don't; no action on the FD itself will affect any of the links to the file referred to by that FD, at least in any of the versions of UNIX I know about. "unlink" takes a path name, not a file descriptor, for obvious reasons. You *do* have to take into account actions on the path, though; if you open a file and then unlink it, if the name you unlink is the same as the name remembered by standard I/O (or anybody else), that name will no longer be valid (the same applies if you rename it from that name).