inode number -> pathname? (4.2BSD)

rsf at Shasta.ARPA rsf at Shasta.ARPA
Mon Jul 8 12:53:24 AEST 1985


I am looking for a good way to generate the full path name of a directory, 
given only its inode number (plus the device number of its filesystem).
Does anyone know if there's a good way to do this in 4.2BSD?  Clearly, being 
able to chdir to the directory, given only its device and inode numbers, 
would be sufficient for my needs.

The 'obvious' solution is to open the file system as a device, parse the data 
structures to find the appropriate inode, and then follow the ".." entries to 
construct the pathname (this is effectively what "ncheck" does).
However, I'd prefer a cleaner solution if at all possible.

Also, does anyone know if this is likely to be any easier to do in 4.3BSD?

	Ross.



More information about the Comp.unix.wizards mailing list