ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.. ???
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?
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
this Solution "Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();"
is a OS Dependence or is universal Solution and work all right in all Operation System ????
this Solution "Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();"
is a OS Dependence or is universal Solution and work all right in all Operation System ????
This works only on POSIX-compliant systems. This means it will work on Linux, most other UNIX systems, etc, but not on Windows.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.