On Jan 3, 2011, at 8:48 AM, eveningnick eveningnick wrote:

> In any sane operating system it is impossible (at least, directly) for
> an application to remove a file that is running.

Not true. Of course if you do start deleting the files of a running executable, 
you can't count on doing much of anything other than completing the job & 
quitting ;-) In particular, you won't be able to reliably provide an error 
message if something goes wrong...

You probably want to move files to a temp directory first. This way if there's 
any file that's locked or has permissions you don't expect, the move will fail, 
and all files will still be there, and you can put back everything you moved, 
then provide an error message. If you do manage to move all files to the temp 
dir, then you have write privs for them all, and should be able to delete them.

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to