On Wed, Oct 27, 2004 at 05:11:23PM +1000, Mike MacCana wrote: > On Wed, 2004-10-27 at 15:42 +1000, Michael Lake wrote: > > > > as its -rw-r--r-- I should not be able to write to it or remove it. > > Im missing some basic understanding. > > You are (but that's OK, I was too until someone told me). If you have > write access to a directory, you can delete files in it. Whether you own > them or not. > > The exception to this is 'sticky' directories, where you must be the > owner of a file or root to delete it.
Oath. It's sometimes useful to think of a "directory" as a file containing a list of filenames (along with their inodes and stuff). So, the act of removing a file is actually a matter of editing the directory. Back in the days when unix was pure and kfish was in nappies, you could actually edit directories directly; or so I've heard. But then some usability nuts came and ruined things as usual, in order to stop people hosing their filesystems. Similarly, you need read access to ls, and to execute a directory you cd into it. Isn't that all beautifully simple? notMike, Kyoto, Japan. http://sully.kfish.org/~conrad/ -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
