是否可以设置文件的POSIX组? [英] Is it possible to set the POSIX group of a file?

查看:124
本文介绍了是否可以设置文件的POSIX组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以使用 Files.setOwner

I am aware that it's possible to set the owner of a file using Files.setOwner:

Files.setOwner(Path path, UserPrincipal owner);

然而POSIX 呢?在API中没有这样的Files.setGroup()方法,甚至没有使用 FileOwnerAttributeView 作品。也只有 setOwner

However what about the POSIX group? There is no such Files.setGroup() method in the API, and not even using the FileOwnerAttributeView works, as there is only setOwner too.

有没有可能?

推荐答案

如果您的应用程序正在专门处理 POSIX 系统,那么 PosixFileAttributeView.setGroup() a>。

If your app is working on POSIX systems exclusively, there's PosixFileAttributeView.setGroup().

这篇关于是否可以设置文件的POSIX组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆