• 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: James Bucanek <email@hidden>
  • Date: Tue, 4 Jan 2011 08:37:50 -0700

eveningnick eveningnick <mailto:email@hidden> wrote (Monday, January 3, 2011 8:48 AM +0200):

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

Who said OS X / BSD had to sane?

As others have already pointed out, you can unlink/delete a file while it is still open by another process. The file will continue to exist until the file is closed, at which time it will really be delete from the file system. Think of files as objects with reference counts.

In my application, I have a special "Uninstall and Quit" menu item. I shutdown and delete launchd configuration files and them move the active components (plug-ins, helpers, ...) to the trash. I find this avoid the problem of deleting files that are part of a bundle (for the plug-ins) that is still in use, and my customers like the transparency of seeing what was removed and being given the control over when they're ultimately deleted.
--
James Bucanek


_______________________________________________

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


  • Follow-Ups:
    • Re: Application that uninstalls itself
      • From: eveningnick eveningnick <email@hidden>
References: 
 >Application that uninstalls itself (From: eveningnick eveningnick <email@hidden>)

  • Prev by Date: Re: When adding Cocoa classes I get a lot of compile errors automatically
  • Next by Date: Re: Event to trigger writeSelectionToPasteboard
  • Previous by thread: Re: Application that uninstalls itself
  • Next by thread: Re: Application that uninstalls itself
  • Index(es):
    • Date
    • Thread