• 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
Re: NSFileManager Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileManager Help


  • Subject: Re: NSFileManager Help
  • From: Jason Coco <email@hidden>
  • Date: Wed, 27 Aug 2008 21:15:53 -0400


On Aug 27, 2008, at 21:08 , J. Todd Slack wrote:

Hi Jason,

It simply does not create the directory. This is code that I had in another project that worked.

What am I missing?

Does the parent directory exist already (~/Application Support/Ring- Maker)? If not, this
call will fail. However, since you're using 10.5 you should use this method:


-(BOOL)createDirectoryAtPath:(NSString*)path withIntermediateDirectories:(BOOL)createIntermediates attributes: (NSDictionary*)attributes error:(NSError**)error;

I saw this, but if I have to deploy on 10.4, will this call fail on 10.4 since it is new in 10.5?

No, it won't. You could check programmatically for 10.5 and call it (at least then, if it fails on 10.5 you will know why) and fall back to the other call on 10.4.


But you were right, the Ring-Maker Directory did not exist. Not I fixed it.

Yeah, that's usually the problem when path creation fails. I never understood why the mkdir system call didn't just automatically create intermediate directories... I think that would have been a much more clever design. Plus ENOENT is a fairly useless error response, but I digress :)


Jason

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSFileManager Help
      • From: "J. Todd Slack" <email@hidden>
References: 
 >NSFileManager Help (From: "J. Todd Slack" <email@hidden>)
 >Re: NSFileManager Help (From: Jason Coco <email@hidden>)
 >Re: NSFileManager Help (From: "J. Todd Slack" <email@hidden>)

  • Prev by Date: Re: NSFileManager Help
  • Next by Date: Re: NSFileManager Help
  • Previous by thread: Re: NSFileManager Help
  • Next by thread: Re: NSFileManager Help
  • Index(es):
    • Date
    • Thread