Re: temporary files and subsequent cleanup
Re: temporary files and subsequent cleanup
- Subject: Re: temporary files and subsequent cleanup
- From: Steve Madsen <email@hidden>
- Date: Fri, 26 Oct 2007 12:25:27 -0400
If you are only storing files during a single run of your application
(not between runs), you aren't sharing the files with anything else,
you have a small number of temporary files AND you can keep them open
at all times, you can probably use an old UNIX trick to ensure that
they are always removed, even if your application crashes. After
opening the file, unlink it, and don't close the file handle. The
file is gone as far as anything else is concerned, but your app can
still read and write to it. As soon as the last file handle is
closed, the file really goes away.
I haven't tested this on OS X, but it works on the UNIXes I'm
familiar with.
--
Steve Madsen <email@hidden>
Light Year Software, LLC http://lightyearsoftware.com
ZingLists: Stay organized, and share lists online. http://zinglists.com
_______________________________________________
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