Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!nrl-cmf!ames!elroy!jpl-devvax!lwall
From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Newsgroups: comp.unix.wizards
Subject: Re: Problem with find(1)
Message-ID: <2935@jpl-devvax.JPL.NASA.GOV>
Date: 26 Sep 88 17:23:58 GMT
References: <108@forsight.Jpl.Nasa.Gov> <815@philmds.UUCP>
Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall)
Organization: Jet Propulsion Laboratory, Pasadena, CA.
Lines: 18

In article <815@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) writes:
: Use the inode number of the directory instead of the name. This should be
: unique. Assuming you use the Bourne shell:
: 
:     set `ls -di /news/spool`
:     find / -inum $1 -prune -o -print ...

We will remind the listeners that an inode number by itself is not necessarily
unique.  A file on a different device could easily have the same inode number.
If that happens to be a directory...

Since find doesn't have a -dnum option (that I know of), you could decrease
the odds of a false positive by checking both the inode and the name.

     find / \( -name 'news' -inum $1 -prune \) -o -print ...

Larry Wall
lwall@jpl-devvax.jpl.nasa.gov