On Apr 14, 2011, at 13:26, Laurent Daudelin wrote:

> it seems to me that if a file is locked, it's pretty obvious it can't be 
> deleted

Sure it can. Unlock it and delete it.

I'm only half joking here. My point is there are a lot of definitions of 
deletability:

-- "Ideal" deletability, which we've already decided is an impossible 
abstraction given different locations (i.e. different file system capabilities, 
some of which may not even be discoverable by your application) and times (i.e. 
file attributes changing behind your application's back).

-- The deletability reported by different APIs. NSFileManager may report 
differently from the low level file manager, which may report differently from 
POSIX functions. Each is potentially a different deletability.

-- The deletability deducible from the behavior of APIs that actually delete 
files, depending on whether they succeed of fail. Again, there's potentially a 
different deletability for each API.

-- The deletability your application wants to report to your users. Since 
there's no ideal deletability, this falls back to what's useful rather than 
what's true.

-- The deletability that your application's deletion operation strategy 
implies. For example, your application might not choose to unlock files for 
deletion, but an application whose purpose *is* to delete locked files will 
want to do so.

That's a lot of deletabilities. It's really no use trying to ding 
'isDeletableFileAtPath:' for failing to be all of them.

On Apr 14, 2011, at 13:16, Quincey Morris wrote:

> you've already found your technical answer: that 'isDeletableFileAtPath:' 
> isn't the solution to the deletability check you wish to make.

Therefore, I stand by that response.


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to