Re: Can i rely on inode numbers?
Re: Can i rely on inode numbers?
- Subject: Re: Can i rely on inode numbers?
- From: Quinn <email@hidden>
- Date: Mon, 14 Apr 2008 11:32:34 +0100
At 14:48 -0700 11/4/08, Jim Luther wrote:
ctually, not all file systems guarantee that inodes don't change
even when a volume is mounted.
Indeed. But I would consider such file systems to be defective (-:
Still, someone off-list reminded me of another way that inode numbers
can change while the volume is mounted, namely, if the file system
object is deleted and the inode (and hence it's number) gets recycled
for another file system object. This is quite rare on HFS-style
volumes (where the inode number is the catalogue node ID, which
generally takes a long time to wrap), but is quite common on other
volume formats (specifically, UFS).
Those volumes formats typically store a generation number for the
sake of programs, like the NFS server, that need to confirm the
identity of a file system object based on a saved inode number.
However, AFAIK, there's no way to get the generation number from a
non-privileged user space program.
I guess the take home message here is that storing inode numbers as
persistent file references is tricky. In most cases it's better to
store an alias, which handles all of this complexity for you.
However, there are circumstances where an alias is not appropriate
(say, for example, you want to store a gazillion such references), in
which cases you will have to deal with all of these tricky cases.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden