Wrong result with createDirectoryAtPath:attributes:
Wrong result with createDirectoryAtPath:attributes:
- Subject: Wrong result with createDirectoryAtPath:attributes:
- From: Stéphane Sudre <email@hidden>
- Date: Sun, 14 Dec 2003 21:38:21 +0100
Let's say I have a Foundation tool run by root (and launched by a
Startup Item on Mac OS X 10.2) which is calling:
- (BOOL)createDirectoryAtPath:(NSString *)path attributes:(NSDictionary
*)attributes
with a valid path and the following attributes (it's an output of the
NSDictionary):
<dict>
<key>NSFileGroupOwnerAccountID</key>
<integer>20</integer>
<key>NSFileOwnerAccountID</key>
<integer>501</integer>
<key>NSFilePosixPermissions</key>
<integer>509</integer>
</dict>
Is it the "specification" that the owner/group of the new folder are:
drwxrwxr-x 13 root admin
?
* drwxrwxr-x is OK.
* root admin is plainly wrong as root == 0 and admin == 80. It should
have been me (501) and staff(20).
The documentation is not stating that you have to provide any other
attributes.
The same problem is also occurring when I try to change the attributes
using:
changeFileAttributes:atPath:
BUT if I then call:
chown(myPath,userID_,groupID_); // user ID= 501 groupID_= 20
the folder owner is perfectly correct.
So I have 2 ideas currently. Either these Foundation APIs are
completely buggy (I doubt it's the case) or the documentation is
completely unclear about what attributes are needed.
Any other idea or suggestion?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.