Java如何动态更新文件权限
Set<PosixFilePermission> ownerWritable = PosixFilePermissions.fromString("rw-r--r--");
FileAttribute<?> permissions = PosixFilePermissions.asFileAttribute(ownerWritable);
Files.createFile(filePath, permissions);
Files.setPosixFilePermissions(filePath, perms);
Loading...