You are not logged in.

#1 2009-08-16 07:26:38

tpolich
Member
Registered: 2009-08-07
Posts: 44

[SOLVED] File permission and my ability to delete anyway

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

#2 2009-08-16 07:28:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: [SOLVED] File permission and my ability to delete anyway

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

#3 2009-08-16 07:52:20

tpolich
Member
Registered: 2009-08-07
Posts: 44

Re: [SOLVED] File permission and my ability to delete anyway

Hmm, never knew that. Thank you for the fast response.

Offline

#4 2009-08-16 08:38:35

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [SOLVED] File permission and my ability to delete anyway

so 000 means the file inherits the permissions from the folder?


neutral

Offline

#5 2009-08-16 08:47:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,395
Website

Re: [SOLVED] File permission and my ability to delete anyway

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

Board footer

Powered by FluxBB