From owner-freebsd-hackers Mon Apr 13 02:27:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA13221 for freebsd-hackers-outgoing; Mon, 13 Apr 1998 02:27:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from beast.gu.net (beast-fxp0.gu.net [194.93.191.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA13216 for ; Mon, 13 Apr 1998 02:27:03 -0700 (PDT) (envelope-from stesin@gu.net) Received: from localhost (localhost [127.0.0.1]) by beast.gu.net (8.8.8/8.8.8) with SMTP id MAA25040; Mon, 13 Apr 1998 12:22:58 +0300 (EEST) (envelope-from stesin@gu.net) Date: Mon, 13 Apr 1998 12:22:58 +0300 (EEST) From: Andrew Stesin Reply-To: stesin@gu.net To: Terry Lambert cc: The Hermit Hacker , freebsd-hackers@FreeBSD.ORG Subject: Re: filename from open file descriptor... In-Reply-To: <199804102218.PAA01789@usr07.primenet.com> Message-ID: X-NCC-RegID: ua.gu MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 10 Apr 1998, Terry Lambert wrote: > > I'm trying to debug some code, and have an open file descriptor > > that I want to find the file name that its associated with... > > > > is this possible? my first thought was fstat(), but that appears > > to return everything but the name :( > > You remember the name when you open the file. How about rename()-ing the already opened file "on the fly"? (Want to note that correct discovery of filename from the filedescriptor seems to be theoretically impossible?) Best regards, Andrew Stesin nic-hdl: ST73-RIPE To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message