java set file permissions to 777 while creating a file object [duplicate]
问题 Possible Duplicate: How can I set the umask from within java? How do you set file permissions to 777(or any other arbitrary permission) while creating a file object in java? 回答1: If you set the umask(2) to 0 before starting the JVM, all files and directories created will be created with full permissions for everyone. This is probably a bad idea. You can use the File.setReadable(), File.setWritable APIs to fiddle with the mode bits after the file has been created. That's often good enough, if