From owner-freebsd-hackers Mon Apr 13 02:32:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA14604 for freebsd-hackers-outgoing; Mon, 13 Apr 1998 02:32:37 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA14597 for ; Mon, 13 Apr 1998 02:32:32 -0700 (PDT) (envelope-from avalon@coombs.anu.edu.au) Message-Id: <199804130932.CAA14597@hub.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA096499964; Mon, 13 Apr 1998 19:32:44 +1000 From: Darren Reed Subject: Re: filename from open file descriptor... To: stesin@gu.net Date: Mon, 13 Apr 1998 19:32:44 +1000 (EST) Cc: tlambert@primenet.com, scrappy@hub.org, freebsd-hackers@FreeBSD.ORG In-Reply-To: from "Andrew Stesin" at Apr 13, 98 12:22:58 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In some mail from Andrew Stesin, sie said: > > 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?) How about just installing and using lsof ? Darren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message