Should find traverse symbolic links?

Root Boy Jim rbj at uunet.UU.NET
Thu Feb 28 09:46:47 AEST 1991


In article <15319 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>
>The fundamental problem is that there is no single "right" method of
>handling symbolic links.  Sometimes one wants them to be truly
>transparent, and other times one wants to notice that they are symlinks.

Exactly. However, most programs fall into the former category.
When they reference a file or directory, all they want is it's contents.

Others are concerned with the filesystem structure itself. They
often treat file specifications as abbreviations for the entire
subtree starting at that node.

There are occasions where one might want to follow links anyway,
such as when making tar tapes to pick up everything logically
below a given directory, or for transport to a machine where
symlinks are not supported. In this case, a special option
(such as -follow or -h) should be provided.

BUT ANYTHING THAT RECURSES SHOULD NOT FOLLOW SYMLINKS BY DEFAULT! PERIOD.

>I could tell you stories about my attempts to decide upon appropriate
>default behavior for this in utilities such as "find" that I adapted
>to work in environments supporting symlinks, but there isn't much
>point to doing so. 

I wish you would. I think the distinction is quite clear.
It's in capital letters eight lines above.

>The bottom line is that symlinks don't fit very
>well into UNIX's idea of hierarchical filesystem structure, and older
>utilities were not designed to provide reasonable options for coping
>with them.

Neither do mount points. They make hard links harder to do.
-- 
		[rbj at uunet 1] stty sane
		unknown mode: sane



More information about the Comp.unix.wizards mailing list