Re: checking if directory is writable
Re: checking if directory is writable
- Subject: Re: checking if directory is writable
- From: Mike Abdullah <email@hidden>
- Date: Tue, 10 Jan 2012 12:03:40 +0000
In order of preference, the best technique last:
1. -attributesOfItemAtPath:error: — can only give you some info info on if the file is writable
2. -isWritableAtPath: — takes more into account, but can't be sure. Gives you no details on *why* isn't writable
3. Actually try to write the directory
Always, always use #3 if you can; it's the only way to be sure.
On 10 Jan 2012, at 08:49, Rick C. wrote:
> Hi,
>
> Just looking for confirmation, I can use NSFileManager isWritableAtPath: if I want to check if a directory can be written to correct? Or do I have to use attributesOfItemAtPath:error:? I don't need to change permissions just to see if it's writable. Thanks!
>
> rc_______________________________________________
>
> 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
_______________________________________________
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