Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inode vs CNID #13

Open
joevt opened this issue Aug 15, 2023 · 0 comments
Open

inode vs CNID #13

joevt opened this issue Aug 15, 2023 · 0 comments

Comments

@joevt
Copy link

joevt commented Aug 15, 2023

Every time I mount a HFS disk image and use ls -il to list the files and directories on that volume, the inode numbers change.

They seem to be assigned in ascending order as directories are accessed. So if you mount the disk, access directory A, then access directory B, then you'll get one set of inode numbers. If you unmount and mount again, then access directory B before directory A then you'll get the numbers in a different order.

Is there a way to make macFUSE use the CNID (HFS Catalog Node ID) numbers instead?

In Mac OS X, there's a .vol directory that can be used to list a file by inode. You just need the device number for the volume. stat can be used to get the device number and inode number.
GetFileInfo can be used to convert a device number and inode number to a path.

stat -f "%d %i" /users/joevt
16777292 36529

GetFileInfo /.vol/16777292/36529
directory: "/Users/joevt"
attributes: avbstclinmedz
created: 09/09/2019 08:06:18
modified: 08/15/2023 12:40:35

Those commands don't work with fusehfs though.

My dumpvols.sh script dumps info from the HFS Master Directory Block. There's some fields in drFndrInfo that use CNIDs. The bless command can be used to view and modify that info, but it doesn't work with fusehfs. I haven't checked the source code to see if it still has support for HFS. I do have a fork that compiles at least.

Do Finder aliases use CNIDs? I know with SheepShaver, if you mount a Mac OS X path in the emulated classic macOS, Finder Aliases created in one instance won't work when running in a different instance. That possibly might be due to the CNIDs not being constant but I haven't checked. I think in SheepShaver, the mount may act more like a network mount since you could access any number of disks through the /Volumes path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant