Try this:
- Get yourself two terminals, cd'd to some temporary directory.
- Make a new folder:
mkdir blah
-
cd blah in both terminals.
- In the first,
echo "foo" > test.
- In the second,
cat test. This should, of course, print "foo".
- Now, in the first...
-
cd ..
-
rm -r blah
-
mkdir blah
-
cd blah
-
echo "bar" > test
-
cat test and ls -la for the sake of sanity. You should see 'test', containing 'bar'.
Try cat test and ls -la in the second terminal. A variety of interesting things may now happen:
- kernel 2.6.11, using ext3, I got the contents of the old file ('foo') and folder.
- kernel 2.4.21, using ext3, I got a "no such file or directory" from cat and a "total 0" from ls -la (not even '.' or '..').
- kernel 2.4.21, over NFS, I got "Stale NFS file handle" errors (which is actually the most sensible response).
Try pwd in both terminals if you want. Interesting, no? Right, now try this...
In terminal one, cd .. ; rm -r blah.
In terminal two, pwd ; cd . ; pwd. Except over NFS, interestingly, cd will panic ("cd: could not get current directory: getcwd: cannot access parent directories: No such file or directory"), and your working directory literally becomes '.'. Oops!
And, no, I don't know why the nested list has broken on ARS. While I swiped the markup from wiki output (just added this to the University one), it's straightforward/nonEvil enough. |