find(1) and symbolic links
Peter da Silva
peter at graffiti.UUCP
Sun Sep 1 00:10:02 AEST 1985
> In all of the 4.2bsd implementations I know about (VAX, Sun, Apollo), find(1) is specifically arranged
> to not follow symbolic links. There are a couple of reasons for this:
> 1) If you follow a symbolic link, it's hard to get back. Going back to .. doesn't work; instead,
> find would have to explicitly keep a stack of the directories it had visited. While this would
> work, it would require find to do a getwd(2) at every directory level, and getwd is pretty slow.
Why would it require find to do a getwd? The file spelling checker in Kernighan
and Pike doesn't. All you have to do is build the directory stack on the fly.
I always assumed find did this rather than depending on ..
hyd-ptd!/usr/src/news and hyd-ptd!/usr/spool/uucp/news.src were the same file
for a while when I was trying to get uucp up on datafact. Find never got lost
here, that I recall.
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list