Directory write permissions -- fail
bof
bof
Mon May 17 11:31:38 PDT 2004
I've been trying to understand permissions on directories, but am having
trouble with the "write" permission.
As I understand it, read permission (r--r--r--) on a directory allows
the contents to be listed, write (-w--w--w-) allows files to be
added/deleted, and execute (--x--x--x) allows access to the file contents.
To test this, I created a directory, foo, and put three files in it:
foo1, foo2, foo3 (contents: this is foo1/2/3). I gave these files
rwxrwxrwx permissions to prevent file permission problems.
Then I changed the foo directory permissions to r--r--r--. I could list
the files, but not do anything else like add/delete or "less" the file
contents. This is as it should be.
Then I changed the directory permissions to --x--x--x. I could list the
file contents using "less", but could not do anything else like "ls -al
foo", or add/delete a file, as should be.
But when I changed the directory permissions to -w--w--w-, I could not
add a new file or delete any of the existing files, getting a
"permission denied" message. This is not as I understand it: I should be
able to do this.
Could anyone explain why?
Thanx.
BOF
More information about the Linux-users
mailing list