From owner-freebsd-hackers Tue Jan 22 15:36: 3 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from gull.prod.itd.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by hub.freebsd.org (Postfix) with ESMTP id 2A93837B404 for ; Tue, 22 Jan 2002 15:35:56 -0800 (PST) Received: from pool0657.cvx21-bradley.dialup.earthlink.net ([209.179.194.147] helo=mindspring.com) by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16TASH-0005nV-00; Tue, 22 Jan 2002 15:35:54 -0800 Message-ID: <3C4DF756.76CA7B5@mindspring.com> Date: Tue, 22 Jan 2002 15:35:50 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Hyong-Youb Kim Cc: freebsd-hackers@freebsd.org Subject: Re: uniquely identifying a file References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hyong-Youb Kim wrote: > What would be a unique id of a file on a local system? Is the full path of > a file the only way to uniquely identify a file? Is there any place I can > get some info on the funtion textvp_fullpath? Thanks. > > I am a complete newbie in kernel hacking so any comment is welcome. What kind of unique identifier do you need? If it has to be node-unique, then the easiest thing is to fstat the file and then use the inode number and the device on which it is mounted. Alternately, if you need a purely numeric value, there is the NFS handle for the file; this is only moderately difficult to use. If it has to be globally unique, then you need the above, plus you need a unique identifier for the node. This is a much harder thing to devise. Generally, people tend to use the MAC address of the first ethernet card in the list of ethernet cards. Basically, FreeBSD doesn't have a way to "big brother" you built into it, like Windows does. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message