Java – Unable to assign group write permission to a file
In Java, we can use the NIO createFile() to assign file permission during file creation. Files.java package java.nio.file; public static Path createFile(Path path, FileAttribute<?>… attrs) throws IOException But, the createFile() fails to assign the group writes file permission to a file on the Unix system? Path path = Paths.get("/home/mkyong/test/runme.sh"); Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwxrwx"); Files.createFile(path, PosixFilePermissions.asFileAttribute(perms)); …