• 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: isDeletableFileAtPath: returns YES for locked files???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isDeletableFileAtPath: returns YES for locked files???


  • Subject: Re: isDeletableFileAtPath: returns YES for locked files???
  • From: Sean McBride <email@hidden>
  • Date: Thu, 14 Apr 2011 14:27:49 -0400
  • Organization: Rogue Research Inc.

On Wed, 13 Apr 2011 16:33:19 -0700, Laurent Daudelin said:

>Is it normal that NSFileManager's isDeletableFileAtPath: returns YES for
>a locked file? Based on the result it returns, when I try to send it a
>removeItemAtPath:error:, it fails and the error localized description is
>'“This is a test.docx” couldn’t be removed because you don’t have
>permission to access it.'. That seems wrong to me. First,
>isDeletableFileAtPath: shouldn't return YES for a locked file.

Sounds broken to me.  But in any case, using methods like
isDeletableFileAtPath: can lead to race conditions.  The file may be
unlocked when you check, but then locked right after, but before you
delete.  See:

<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

References: 
 >isDeletableFileAtPath: returns YES for locked files??? (From: Laurent Daudelin <email@hidden>)

  • Prev by Date: Re: Anybody using NSFileManager here?
  • Next by Date: Re: Anybody using NSFileManager here?
  • Previous by thread: isDeletableFileAtPath: returns YES for locked files???
  • Next by thread: Re: isDeletableFileAtPath: returns YES for locked files???
  • Index(es):
    • Date
    • Thread