Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ucf-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!drutx!mtuxo!mtunh!mtung!mtunf!ariel!vax135!petsd!peora!ucf-cs!tim From: tim@ucf-cs.UUCP (Tim Curry) Newsgroups: net.unix-wizards Subject: Re: inode number -> pathname? (4.2BSD) Message-ID: <2071@ucf-cs.UUCP> Date: Tue, 9-Jul-85 13:46:49 EDT Article-I.D.: ucf-cs.2071 Posted: Tue Jul 9 13:46:49 1985 Date-Received: Fri, 12-Jul-85 00:40:30 EDT References: <6727@Shasta.ARPA> Organization: Univ. of Central Florida, Orlando Lines: 23 From rsf@Shasta.ARPA Sun Feb 6 01:28:16 206 Newsgroups: net.unix-wizards Subject: inode number -> pathname? (4.2BSD) Organization: Stanford University >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. How about: find / -inum inode-number -print -- Tim Curry USENET: decvax!ucf-cs!tim ARPANET: tim.ucf-cs@csnet-relay