find(1) and symbolic links

Guy Harris guy at sun.uucp
Fri Aug 16 18:14:04 AEST 1985


> On our Suns, running Sun Unix(TM) 4.2 BSD, Releases 1.2, 1.3, 1.4,
> a find(1) will fail when the pathname-list is a symbolic link.
> 
> find does not seem to expand the link, or use readlink(), or anything
> else. Is it meant to, or should a find just give no output,
> as though there weren't any files?

The 4.2 manual doesn't come out and say it explicitly, but the 4.2 "find"
treats symbolic links as symbolic links, rather than looking at what they
point to.  The manual does say:

	-type C     True if the type of the file is C, where C is
		    "b", "c", "d", "f" or "l" for block special file,
		    character special file, directory, plain file, or
		    symbolic link.

which does imply that it does an "lstat" rather than a "stat", and looks at
symbolic links rather than at what they point to.  (This is in standard
4.2BSD.)

	Guy Harris



More information about the Comp.bugs.4bsd.ucb-fixes mailing list