Re: Catching Cocoa application Crash
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