Reputation: 5323
I am looking how to get (and set) owner, group and permissions in Cocoa for a given file.
What is the best way to do this? (and how to check if the current user is granted enough to change these permissions)
Thanks for your help,
Regards,
Upvotes: 3
Views: 2027
Reputation: 86651
NSFileManager has a method -setAttributes:OfItemAtPath:error: which will do the trick. Check out particularly the NSFilePosixPermissions key. If the method fails, it returns false and the details of the error are placed in the NSError**
you give it.
Upvotes: 4