How to change file permissions from Java 1.4.2?
问题 I'm looking for a code fragment, using which I must be to change the file permissions on unix. My project runs on java 1.4.2 .. just a sample code example or methods which needs to be used will do.. Regards, Senny 回答1: You're not the only one: How to change the file's permission and last modified in Java? You could, in principle, use Runtime.exec("chmod ...") if the existing java.io.File methods aren't enough. But it wouldn't be portable. 回答2: You could also look at the Gnu ClassPath