I create a folder in my java program (running on linux) with mkdirs() function of File object. The problem is that the folder gets only read permissions for the group. I nee
A very simple solution for this is:
file.setExecutable(true, false);
file.setReadable(true, false);
file.setWritable(true, false);
In above code, file is a File object.
When you are creating a file set these permissions to a file setExecutable(true)
will allow you to set that file as Executable
for owner only. If you add one more parameter which I have added in above code file.setExecutable(true, false);
will make Executable
false
for owner only, that means it will set permissions to all group / world.
Tested and working on Debian and Windows XP.