Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ttrdc.UUCP
Path: utzoo!linus!decvax!harpo!whuxlm!whuxl!houxm!ihnp4!mgnetp!ltuxa!ttrdc!levy
From: levy@ttrdc.UUCP (Daniel R. Levy)
Newsgroups: net.unix-wizards
Subject: Re: inode number -> pathname? (4.2BSD)
Message-ID: <274@ttrdc.UUCP>
Date: Sat, 13-Jul-85 22:27:06 EDT
Article-I.D.: ttrdc.274
Posted: Sat Jul 13 22:27:06 1985
Date-Received: Mon, 15-Jul-85 02:28:24 EDT
References: <6727@Shasta.ARPA> <2071@ucf-cs.UUCP> <2414@sun.uucp>
Organization: AT&T Teletype Corp., Skokie, IL
Lines: 39

guy@sun.uucp (Guy Harris) <2414@sun.uucp>:
>
>> >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).
>> How about:
>> 
>> 	find / -inum inode-number -print
>
>Well, this is even slower than "ncheck", and will report *all* files that
>have that inumber; remember, the problem was "translate a device/inumber
>*pair* to the directory with that inumber *on that device*".
>
>	Guy Harris
>
>P.S. 4.xBSD is the only UNIX that documents "-inum" but I think it's been in
>there since V7 and is thus in S3 and S5 as well.
>

'Scuse me, Guy (I've been landed on with both feet before by several users
when I asked a mild question about something you said earlier, so I am try-
ing to be cool about this) but why not 

find /file_system -inum inode_# -print [maybe -exec ls -l {} \;]

which would restrict the search for the inum to the file system on the device
in question?  That would be a bit quicker than searching all filesystems, as
a find on root would do.  A mount command would show what's mounted on what,
so you'd know which filesystem to search.

Sorry if I misunderstand.  Please readers if you answer don't just holler
'Guy knows his Unix' this time.  Maybe it's still slower than ncheck (I
haven't timed it yet).

thanks.

dan levy
at&t teletype corp
skokie ill
..!ihnp4!ttrdc(!ttbcad)!levy