Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jan 2002 15:35:50 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Hyong-Youb Kim <hykim@cs.rice.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: uniquely identifying a file
Message-ID:  <3C4DF756.76CA7B5@mindspring.com>
References:  <Pine.GSO.4.33.0201221711520.2676-100000@vaud.cs.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C4DF756.76CA7B5>