• 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: Catching Cocoa application Crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching Cocoa application Crash


  • Subject: Re: Catching Cocoa application Crash
  • From: Jens Alfke <email@hidden>
  • Date: Fri, 8 Feb 2008 08:12:10 -0800


On 8 Feb '08, at 5:00 AM, parag vibhute wrote:

1. I have created a named pipe in /tmp folder.
2. My requirement is to remove it when my application quits.
3. Imp. thing is my application runs in user session & can't be launched
using lauch agent.
4. I selected /tmp folder bcoz if user shutdowns abruptly then on next
reboot, /tmp folder gets cleared.
5. But in same user session, suppose if my application gets crashed then
that file does not get deleted.

Trying to perform actions after your app crashes is really difficult. A much simpler solution is to fix #5 by making the application handle the case where the file already exists when it launches. Either pick a random filename using something like mkstemp (and iterate until there's no collision), or if you need to hardcode the name, just delete any leftover copy of the file.


--Jens
_______________________________________________

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: 
 >Catching Cocoa application Crash (From: "parag vibhute" <email@hidden>)
 >Re: Catching Cocoa application Crash (From: "parag vibhute" <email@hidden>)

  • Prev by Date: Re: How to detect focus on an NSTextField
  • Next by Date: Re: help with closing file handle
  • Previous by thread: Re: Catching Cocoa application Crash
  • Next by thread: Re: Catching Cocoa application Crash
  • Index(es):
    • Date
    • Thread