Re: NSFileManager - a cautionary tale
Re: NSFileManager - a cautionary tale
- Subject: Re: NSFileManager - a cautionary tale
- From: Sean McBride <email@hidden>
- Date: Fri, 05 Aug 2011 10:21:04 -0400
- Organization: Rogue Research Inc.
On Thu, 28 Jul 2011 13:38:49 -0700, Greg Parker said:
>>> However, this method eventually calls mkdir, which fails with an
>error if the directory already exists. This call to mkdir causes the App
>Store reviewers to have conniptions, even though it certainly fails. The
>failure of mkdir is interpreted by NSFileManager as a success (i.e. the
>method apparently works by attempting the mkdir, rather than checking
>for its existence beforehand).
>
>Did you file a bug report?
Can one file bugs against App Store stupidity? :)
But seriously, isn't it recommended practice to attempt things like file creation, instead of checking if it exists, in order to avoid race conditions?
<http://developer.apple.com/library/mac/#documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html>
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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