[comp.unix.wizards] Should \"ls -R\" traverse symlinks?

rbj@dsys.ncsl.nist.gov (Root Boy Jim) (06/24/89)

? From: Jonathan <jonathan@comp.vuw.ac.nz>

? 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.

The dual-universe was perhaps a useful concept when it was introduced,
but I think it creates more problems than it solves. A more useful
concept would be dual galaxys.

The problem comes when porting code from other systems which include
features from both universes. Even though it's all there, include files
and librarys from the other universe are hard to get to.

We solved this problem (on a Sequent, see below) by crosslinking all
include files in each universe that didn't conflict with each other,
and by linking libucb.a and libatt.a to the appropriate real librarys
in both universes.

? 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?

Sequent uses the dual-universe concept, implemented with csymlinks.
Their implementation was based on Doug Gwyn's System V environment
for BSD systems (presumably it has a better name than that). In a private
communication, he said he preferred Sun's (and presumably that of Ultrix
and other vendors) approach: whatever mishmash of features you provide,
make it into one integrated whole. I am sure that if I have misstated
his views, he will let everyone know.

There is also a readclink call that gets both names, and the lstat
command returns a funny bit somewhere denoting a csymlink.

? Discussion, anyone?? 

No, but how about some arguments and flames :-?

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

	Root Boy Jim is what I am
	Are you what you are or what?

rbj@dsys.ncsl.nist.gov (Root Boy Jim) (08/05/89)

? From: Jonathan <jonathan@comp.vuw.ac.nz>

? In article <558@lakart.UUCP> dg@lakart.UUCP (David Goodenough) writes:
? >flee@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.

So far, so good.

? 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.

But this is exactly *backwards* according to the definition. The -L
option is supposed to pretend that the symbolic link is a hard one.

?   (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.

BSD ls *sometimes* follows symlinks. Without `-l', it does, with it it
doesn't.  It always does with `-L'. Since symlinks were a BSD invention
(well, the first implementation anyway), it must be either considered
the standard, or called into question and changed by mutual agreement.

SunOS, on the other hand, *never* follows symlinks, unless given `-L'.

? 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?

Actually, I think I prefer Sun's behavior, but would rather see the
new name pointing to the old in the listing: foo -> bar.

? 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?

Sequent uses conditional symbolic links and the dual universe scheme.
They use one of the spare fields in the stat structure to tell the
difference between symlinks and csymlinks.

Are you sure there is no way to tell the difference in OSx?
How does ls print the value of a csymlink? Sequent's does it like:

% ls -ld /bin

lrwxr-xr-w ...... /bin -> ucb=.bin att=/usr/att/bin

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

	Root Boy Jim
	Have GNU, Will Travel.