Re: Application that uninstalls itself
Re: Application that uninstalls itself
- Subject: Re: Application that uninstalls itself
- From: Scott Ribe <email@hidden>
- Date: Mon, 3 Jan 2011 09:03:05 -0700
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
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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