开发者

Setting group and owner of a file in obj-c

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜