Should "ls -R" traverse symlinks?

Jonathan jonathan at comp.vuw.ac.nz
Sun Jun 18 22:08:06 AEST 1989


In article <558 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
>flee at shire.cs.psu.edu (Felix Lee) sez:
>> No.  Not unless "ls -R" detects cycles and guarantees termination.
>> If you really want to traverse links, "ls -RL" is almost adequate.
>
>Agreed

These postings have completely lost the point of the original query, which
was ``Should ls -R traverse symlinks on a *Pyramid*''?

Pyramid's OSx is a dual-universe Un*x implemented using conditional symbolic
links---symlinks that contain the names of two files, one each for the bsd
and att universe. For instance, /bin is a csymlink to .ucbbin and .attbin,
respectively.

Since OSx's lstat(2) does not distinguish between ordinary symlinks
and csymlinks (perhaps because Pyramid didn't want to break user code
that happened to do an lstat on a c-symlink; perhaps because the
implementation is a  kludge), having OSx commands do different things for
ordinary symlinks and conditional symlinks is well-nigh impossible.

Pyramid have modified several OSx commands to grok conditional symbolic
links.  OSx's ls follows symlinks symlinks by default,
*doesn't* follow them for ls -L.

  (This makes sense to me. Seeing the conditional symlinks is 
  generally not what people or shell scripts want to do. The
  incompatibility of ls itself is rather annoying, especially in an
  environment with other Unix implementations.)

Since ls follows symlinks by default, it seems consistent and least
surprising for ls -R to to traverse symlinks, which can lead to the
problems already discussed.  Perhaps an option meaning "follow
conditional, but not ordinary, symlinks" is what's wanted.

Despite Pyramid's inelegant implementation, there is an interesting
issue here: What should the behaviour of  ls (+ system calls, other
commands) be when the mapping from pathnames to files is a relation
rather than a function?

Are there any other systems that use conditional symbolic links?
Do Sequent systems deal with this issue, and if so, how?  Are there
any heterogenous distributed systems that use conditional symbolic links?

Discussion, anyone?? 
--
-----------------------------------------------------------------------------
sane mailers: jonathan at comp.vuw.ac.nz |    NZ Industrial democracy:
UUCP path: ...!uunet!vuwcomp!jonathan |           One factory, one vote!



More information about the Comp.unix.wizards mailing list