Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to prevent my digital photos (.jpg files) from accidental deletion using chmod 444 *.jpg. All permissions are set and displayed correctly in a terminal (ls -la) as well as in thunar's file properties > permissions. The files are displayed with a lock symbol. Even though, whenever I press "delete", the marked file is moved to trash. My expectation was that files without write permission could not be moved to trash. Is it a bug or am I just wrong assuming that moving a file requires write permission?

share|improve this question

Actually, Nautilus behaves the same (as does bash terminal). You can delete a read-only file, because it is the directory permissions that control that operation. In theory, you can't write to a read-only file, although many editors will delete the original (or make a backup), then write to a new file, so it seems that you can write to the read-only file.

If you were to make the permissions for a directory r-x, then you would not be able to delete any files (but you could still write to the files, assuming they are not read-only).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.