Re: Suggestion: a garbage-collected file system

From: David Madore (david.madore@ens.fr)
Date: Fri Jan 14 2000 - 18:07:43 EST


Bruce Janson has pointed out to me the following interesting fact:
whereas some people have been criticizing as "un-unixy" my proposal to
admit hard links between directories, it was actually permitted in the
very first versions of Unix, as shown in the following transcript of a
test I just made:

@unix

login: root
# chdir /tmp
# ls -l
total 0
# mkdir foo
# ln foo bar
# ls -l
total 2
drwxrwxrwx 3 root 32 Mar 21 12:13 bar
drwxrwxrwx 3 root 32 Mar 21 12:13 foo
# ed foo/test
?
a
This is a test.
..
w
16
q
# ls -l bar
total 1
-rw-rw-rw- 1 root 16 Mar 21 12:13 test

This is on Unix V5. Unix V7, on the other hand, disallows hard links
on directories. As for Unix V6, well, the version I have seems to
have a bug on this (it will create the link, but after that, the
strangest things happen when I try to move to the directories in
question).

Also, on Unix V5, creating a link from a directory to a subdirectory
of itself (as per mkdir foo; ln foo foo/bar) will result in a loop
that cannot be removed (or so it seems).

While we're off topic, but still on the subject of strange semantics
and how they might break things, notice the following strange
behaviour of zsh:

pleiades david /tmp $ mkdir foo
pleiades david /tmp $ cd foo
pleiades david /tmp/foo $ mkdir bar
pleiades david /tmp/foo $ cd bar
pleiades david /tmp/foo/bar $ rmdir .
pleiades david /tmp/foo/bar $ rmdir ..
pleiades david /tmp/foo/bar $ stat . | grep Inode
Device: 3,5 Inode: 30142 Links: 0
pleiades david /tmp/foo/bar $ zsh
pleiades david . $ stat . | grep Inode
Device: 3,5 Inode: 30137 Links: 0

(The strange behaviour I'm referring to is *not* the fact that the
prompt lists the cwd as . - that is quite normal since there is no cwd
in any meaningful sense. What worries me is that actually the cwd has
changed from /tmp/foo/bar[deleted] to /tmp/foo[deleted] fod no
adequately explained reason.)

-- 
     David A. Madore
    (david.madore@ens.fr,
     http://www.eleves.ens.fr:8080/home/madore/ )

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:25 EST