Monday, March 7, 2011

File permissions

I've been having some problems sharing files between users on my computer. So have others, it seems. But I don't think the problem was a bug- rather my failure to use the GUI properly. Now possible the GUI is not very intuitive, but that's another question.
I'd copied some files from my external hard drive into my home directory, and was trying to give permission to another user to read all the files in the directory, but the "Apply Permissions to Enclosed Files" button didn't seem to be working.
I think I worked out what I was doing wrong. Copying the file from the external disk meant that group access was set to none on files.


Trying to set file permissions for other users to read the file would fail without setting Group>File access to Read-only in the drop down menu in the folder permissions menu, as well as setting file access to other users to Read and write, before hitting the Apply Permissions to Enclosed Files button.


The behaviour of the drop down boxes is a little perplexing. Upon opening the folder permissions menu, the drop down boxes show "---". If an action selected from the box will not change any attribute of an enclosed file (for example, all the files are already Read-only for the named group). Once Apply Permissions to Enclosed Files is clicked, the drop down boxes will again show "---". It would be useful to get a message saying No attributes will change or File attributes have been changed.


Finally, I noticed that moving files from one users account to another's would leave the owner of the files set as the first user's name, and also the group, making it impossible to change file permissions. Copying the files over means the new files are owned by the user to whose account they have been transferred. To change the owner if necessary, use the chown command. The command below will set owner and group of a directory and file contents to the new user name.
$ chown -R username:username somedir
It seems that Gnome is behaving logically in the way permissions are handled by the GUI, but that that logic is not always intuitive to the user, hence the confusion here. Bruno Girin's post attempts to explain, and hopefully this post will prove useful to somebody in similar confusion to mine. Maybe the Gnome developers could also make the permissions menu a little more intuitive to users.

1 comment:

  1. for other information about file permission,please click http://en.wikipedia.org/wiki/Chmod

    ReplyDelete