Is it possible to set the POSIX group of a file?

浪尽此生 提交于 2019-12-23 19:17:05

问题


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

Files.setOwner(Path path, UserPrincipal owner);

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.

Is it possible at all?


回答1:


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



来源:https://stackoverflow.com/questions/18686099/is-it-possible-to-set-the-posix-group-of-a-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!