• 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: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists


  • Subject: Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
  • From: Andreas Grosam <email@hidden>
  • Date: Wed, 31 Oct 2012 10:30:14 +0100

On 30.10.2012, at 19:17, Quincey Morris wrote:

> On Oct 30, 2012, at 10:39 , Sean McBride <email@hidden> wrote:
>
>> Note that in my experience YES is returned if the directory exists.
>
> It's also worth consulting the header file comments:
>
>> "createDirectoryAtPath:withIntermediateDirectories:attributes:error: creates a directory at the specified path. If you pass 'NO' for createIntermediates, the directory must not exist at the time this call is made. Passing 'YES' for 'createIntermediates' will create any necessary intermediate directories. This method returns YES if all directories specified in 'path' were created and attributes were set. […] This method returns NO if a failure occurs at any stage of the operation."
>
> There's a certain inscrutability to this, but it seems to suggest that passing 'YES' for createIntermediates will allow the directory to already exist (in effect, the directory is created as one of the "intermediates"), while passing 'NO' requires the directory not to exist.
>


Thanks for the hint to consult the headers. IMO, this clears it up -- and it works now as expected when parameter `createIntermediates` is set to `YES`.
The need to consult the headers seems to become a standard task. But with clang's symbol lookup, it's a quite comfortable. ;)

Andreas
_______________________________________________

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


References: 
 >createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists (From: Andreas Grosam <email@hidden>)
 >Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists (From: Sean McBride <email@hidden>)
 >Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Event loop expiration date insight
  • Next by Date: Programmatically providing default value for new core data attribute?
  • Previous by thread: Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
  • Next by thread: More NSFileManager Issues
  • Index(es):
    • Date
    • Thread