2

I am using RStudio server (Version 0.98.994) on Ubuntu 12.04.

Our group works on a external share drive together and would like to open the same project.

When I open a project file created by other colleagues, I got an error with permission denied (Sorry I cannot show the error message as I already changed the permission manually).

After checking the file permission, I found the default permission is "-rw-r--r-x" for *.Rproj and .Rhistory, "drwxr-sr-x" for ".Rproj.user". So no write permission for group.

In the external share drive (no sure about system, should be Linux), the default permission is rw for group.

How could I change the default permission for *.Rproj, .Rhistory and .Rprojt.user?

Thanks for any advice. Please let me know if my question is not clear.

EDIT:

I created new file and folder in the external share drive from command line. The default permission is -rw-rw-r-- for file and drwxrwsr-x for folder, as I expected. It seems RStudio server created these new files with their own default permission.

Could I change the default permission of these files *.Rproj, .Rhistory and .Rprojt.user when RStudio server creates them? i.e. Add write permission to group.

2
  • I think a safer route would be to fork/clone a project (perhaps from GitHub) and work on a project locally. It would also be a good exercise in git/svn and backuping work. Collaboration for writing code isn't like sharing a google doc document, and rightfully so. Aug 19, 2014 at 9:07
  • Yes svn/git is the best way to share the codes. But in my base, our supervisor would likes to directly view the students' codes and results.
    – Bangyou
    Aug 19, 2014 at 11:15

1 Answer 1

2

The default permissions for Directories are 777 which is read/write/execute and for Files it is 666 which is read/write. But then every system has a umask value, which is normally 022.

So when you create a directory it will have permissions 777 but it will take away the umask value of 022 and leave you with your default permissions of 755 which is rwxr-xr-x

You can change the value of umask by simply entering the command

umask=055

This will set the umask value to 055 and whenever you create a new file/directory, 055 will be taken away from the permissions.

Again look at a newly created directory with permissions of 777 and the umask value is taken away so the directories permission is 722 which is rwx-w--w- Again look at a new directory with permissions

3
  • Thanks for your suggestions. I created a new file and folder in the external share drive by myself. The default permission is -rw-rw-r-- for file and drwxrwsr-x for folder. It seems RStudio server created these new files with their own default permission. Will edit my question to clarify this.
    – Bangyou
    Aug 19, 2014 at 11:21
  • 1
    @Bangyou you can put Sys.umask("002") at the top of your script or in your .Rprofile
    – GSee
    Oct 30, 2014 at 1:33
  • Thanks for your comments. We have solved our problems through change the default group permission in the share drive.
    – Bangyou
    Oct 30, 2014 at 5:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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