The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Fun with Linux and filesystems. by LionsPhil 2005-09-11 16:11:37
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.
[ Reply ]
  Oh, Gods, I do know. by LionsPhil2005-09-11 16:13:21
  linux-2.6.10-gentoo-r6 - ext3 by Pic2005-09-11 16:16:32
    Maybe it's quantum. by LionsPhil2005-09-11 16:17:13
  In term 2: echo "blubb">test gives "blubb" in term by Mad Marty2005-09-11 16:34:31
  hmmm by Spudd862005-09-11 17:43:51

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)