prain
asked on
Directory Permissions problem when using mkdir() of the File class
Hello,
I hava a Java application that creates directories using the mkdir() method of the File class. This is in UNIX. when the directory is created by madir() it has drwxr-xr-x permissions string by default. As you can see the user has r/w/ex permissions, and the group has only r/ex permissions and does not have 'write' permissions. Our requirement is, when this directory is created, we must give permissions to the group also for writing.
Since mkdir() defaults to drwxr-xr-x, how can I set the peremissions to be drwxrwxr-x so that the group will also have write permissions when the directory is created.
Thanks
prain
I hava a Java application that creates directories using the mkdir() method of the File class. This is in UNIX. when the directory is created by madir() it has drwxr-xr-x permissions string by default. As you can see the user has r/w/ex permissions, and the group has only r/ex permissions and does not have 'write' permissions. Our requirement is, when this directory is created, we must give permissions to the group also for writing.
Since mkdir() defaults to drwxr-xr-x, how can I set the peremissions to be drwxrwxr-x so that the group will also have write permissions when the directory is created.
Thanks
prain
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No. Java is platform independent, so would have no platform-dependent way of altering file perms
ASKER
Ok. That' right. I will try this.
ASKER
OK. That works Great!. Thanks.
:-)
Which way did you go in the end?
Which way did you go in the end?
ASKER
I set the permissions using chmod 775 by Runtime.exe();
ASKER