Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
- Subject: Re: createDirectoryAtPath:withIntermediateDirectories:attributes:error: Returns NO when it exists
- From: Quincey Morris <email@hidden>
- Date: Tue, 30 Oct 2012 11:17:17 -0700
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.
_______________________________________________
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