• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can i rely on inode numbers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Can i rely on inode numbers?
      • From: Mark Day <email@hidden>
References: 
 >Can i rely on inode numbers? (From: Lutz Helwing <email@hidden>)
 >Re: Can i rely on inode numbers? (From: Quinn <email@hidden>)
 >Re: Can i rely on inode numbers? (From: Jim Luther <email@hidden>)

  • Prev by Date: Re: How to canonicalize the case of a filename or path?
  • Next by Date: Re: Can i rely on inode numbers?
  • Previous by thread: Re: Can i rely on inode numbers?
  • Next by thread: Re: Can i rely on inode numbers?
  • Index(es):
    • Date
    • Thread