You are not logged in.
I was trying to make a file that couldn't be deleted in my own home folder so I did.
$nano
hit a few keys then and saved it as "roar.txt" then I went
$chmod 000 roar.txt
then I tried to delete it and it poof it gets deleted. If I do the same thing with a directory instead I can't delete it so why am I allowed to delete text files?
Last edited by tpolich (2009-08-16 07:52:39)
Offline
The permissions come from the directory the file is in rather than the file itself.
Edit: you should still be able to rmdir a directory
Offline
Hmm, never knew that. Thank you for the fast response.
Offline
so 000 means the file inherits the permissions from the folder?
Offline
Someone asked this on the coreutils mailing list in the last week or two. Here was the response:
The permissions of the parent directory control whether you can remove
a file from within it. The permissions of the file being removed are
not the controlling factor. (And a directory is just a special file
and follows the same rules.)
Offline