• 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: Application that uninstalls itself
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Application that uninstalls itself (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: Re: Application that uninstalls itself
  • Next by Date: Custom View with Interface Builder Bindings
  • Previous by thread: Re: Application that uninstalls itself
  • Next by thread: Re: Application that uninstalls itself
  • Index(es):
    • Date
    • Thread