> pavel@Elf:/tmp$ mkdir delme
> pavel@Elf:/tmp$ cd delme/
> pavel@Elf:/tmp/delme$ ls -al
> total 17
> drwxr-xr-x 2 pavel users 1024 Sep 10 13:11 ./
> drwxrwxrwt 5 root root 15360 Sep 10 13:11 ../
> pavel@Elf:/tmp/delme$ rmdir .
> pavel@Elf:/tmp/delme$ ls -al
> total 17
> drwxr-xr-x 0 pavel users 1024 Sep 10 13:11 ./
> drwxrwxrwt 4 root root 15360 Sep 10 13:11 ../
All the links to '.' have been deleted (incl. '.' itself) (acatually, these
shouldn't be deleted), but these two files are still listed since '.' and
'..' don't have to go through lookup (they are "created" by dcache).
> pavel@Elf:/tmp/delme$ > testfile
> bash: testfile: Operation not permitted
By spec.
> pavel@Elf:/tmp/delme$ mkdir .
> mkdir: cannot make directory `.': No such file or directory
Looks up the absolute pathname by doing "<pwd>/.". (BTW - if the inode of
the current dir is linked into anway). But since the last element of pwd
dosn't exist, the lookup fails.
> pavel@Elf:/tmp/delme$
>
> Link count of 0 seems pretty nice to me. Well, you decide if this is
> correct behaviour.
It's not strictly to spec (by spec, the '.' and ".." entries aren't deleted
until the pwd is changed (until there are no fds refering to files in that
directory, or to the directory, and no processes have that as it's pwd).
But it's nice anyway.
> Pavel
-=- James Mastros
--- I can now be reached again at abszero@epix.net or root@jennifer-unix.dyn.ml.org. "Shooting as [a] communications method is obsolete even here in Bosnia, so I'll skip over it." -=- Dragisha Durich