Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!allegra!ulysses!sfmag!sfsup!mpl From: mpl@sfsup.UUCP Newsgroups: comp.unix.questions Subject: Re: Identify file name given file descriptor Message-ID: <1419@sfsup.UUCP> Date: Mon, 11-May-87 15:27:36 EDT Article-I.D.: sfsup.1419 Posted: Mon May 11 15:27:36 1987 Date-Received: Thu, 14-May-87 02:10:23 EDT References: <710@twitch.UUCP> Organization: AT&T-IS, Summit N.J. USA Lines: 25 Summary: need device and inode number In article <710@twitch.UUCP>, grt@twitch.UUCP writes: > .... > One then generates and runs a command "/etc/ncheck -i inode blockdevice". > On twitch one must be super-user to do that; I tried a file, and it took > several minutes for ncheck to find the name. One then needs /etc/mount > .... On the last project I worked on, someone (Larry Feigen to give him credit) wrote a program called "fdcheck". It does the following for each file descriptor of interest: runs /etc/mount to get the mount points of all mounted file systems does a stat to get the device number for each mounted file system does an fstat on the file descriptor(s) to get the device/inode number(s) does a "find dir -print | xargs ls -i | sed -e ...." to pick out the path names of interest. This method is surprisingly fast (takes a minute or 2 on our 3B20s with big disks - a little longer on slower machines), and if you give the program some hints as to where you think the files might be (he has a way of passing it a file with a table of such info in it), it can get by in just a few seconds! Mike Lindner