File with Default Execution Permission
hi folks
i have java programm that create a file application needs exexution & Write permission for file but in linux files have not a execution Permission by default how can i configure the linux to creat a file with execution permission by default.. ??? thanks to all |
Hi there,
As far as I know there is no way to set execute permission by default on a newly created file. You might be able to change the permissions from within your Java program after creating it, though. Which version of Java are you using? In Java 7, try setPosixFilePermissions() in the java.nio.file class. Out of curiosity, any particular reason you need execute permission? This is an unusual requirement. What files are you creating that need this? Regards, Clifford |
cliffordw
i am writing a project under cloud Computing Design,, and admin user can add new function to the server and i want to compile the function before adding to the server in linux when we create a file,, execution permission is not as default, for this reason i cant run the file for compile setPosixFilePermissions() did worked.. thanks man.. |
at last i have a question
this Solution "Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();" is a OS Dependence or is universal Solution and work all right in all Operation System ???? |
Quote:
|
All times are GMT -5. The time now is 12:25 PM. |