• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Wrong result with createDirectoryAtPath:attributes:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Wrong result with createDirectoryAtPath:attributes:
      • From: Sherm Pendley <email@hidden>
    • Re: Wrong result with createDirectoryAtPath:attributes:
      • From: Nat! <email@hidden>
  • Prev by Date: NSBox and its contentView
  • Next by Date: Intercepting JavaScript calls in WebViews
  • Previous by thread: Re: [solved] NSBox and its contentView
  • Next by thread: Re: Wrong result with createDirectoryAtPath:attributes:
  • Index(es):
    • Date
    • Thread