开发者

Setting group and owner of a file in obj-c

开发者 https://www.devze.com 2023-03-13 03:55 出处:网络
I am trying to change group and owner of a file in a cocoa application and was planning to use setAttributes:ofItemAtPat开发者_如何学运维h:error: method of NSFileManager

I am trying to change group and owner of a file in a cocoa application and was planning to use setAttributes:ofItemAtPat开发者_如何学运维h:error: method of NSFileManager

However I was wondering how to get possible values for NSFileGroupOwnerAccountID and NSFileOwnerAccountID

Thanks


If you know the name of the particular user or group, you can use getpwnam(3) and getgrnam(3) to obtain the corresponding ids.

If you want to iterate over the list of users or groups, you can use getpwent(3) and getgrent(3).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号