file removal problem

Alexander Skwar listen at alexander.skwar.name
Fri Aug 4 10:31:36 UTC 2006


Dieter Schicker <dieter.schicker at uni-graz.at>:
 
>> cr-x-wS--- 44040 2262871048 2899800918 37, 234 2061-06-17 08:11
>> areas2.png
>> 
>> l-w-rw---T 44251 1904258270 2899942416 10922 2061-12-01 12:13 word.gif
> 
> The access rights seem to be screwed up. Maybe try "chmod 644
> areas2.png" and then remove it. See also "man chmod".

Access rights on a a file don't matter if the fiel is to be deleted.
Only the rights on the "containing" directory are important. 

Picture: Files are listed in a directory (in a list). Removing an entry
from this list means, that the list is to be modified. NOT the entry
itself!

Proof:

[12:30:41 vz6tml at dewup-ww02:~/tmp/remove] $ ls -la
insgesamt 1
dr-xr-xr-x 2 vz6tml pcei   72  4. Aug 12:30 .
drwxr-xr-x 8 vz6tml pcei 1048  4. Aug 12:30 ..
-rw-rw-rw- 1 vz6tml pcei    0  4. Aug 12:30 file
[12:30:43 vz6tml at dewup-ww02:~/tmp/remove] $ LC_ALL=C rm file
rm: cannot remove `file': Permission denied
[12:30:47 vz6tml at dewup-ww02:~/tmp/remove] $ chmod u+w .
[12:30:55 vz6tml at dewup-ww02:~/tmp/remove] $ ls -la
insgesamt 1
drwxr-xr-x 2 vz6tml pcei   72  4. Aug 12:30 .
drwxr-xr-x 8 vz6tml pcei 1048  4. Aug 12:30 ..
-rw-rw-rw- 1 vz6tml pcei    0  4. Aug 12:30 file
[12:30:57 vz6tml at dewup-ww02:~/tmp/remove] $ LC_ALL=C rm file
[12:30:59 vz6tml at dewup-ww02:~/tmp/remove] $ ls -al
insgesamt 1
drwxr-xr-x 2 vz6tml pcei   48  4. Aug 12:30 .
drwxr-xr-x 8 vz6tml pcei 1048  4. Aug 12:30 ..

Alexander Skwar
-- 
If you permit yourself to read meanings into (rather than drawing meanings out
of) the evidence, you can draw any conclusion you like.
-- Michael Keith, "The Bar-Code Beast", The Skeptical Enquirer Vol 12 No 4 p 416






More information about the ubuntu-users mailing list