• 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: temporary files and subsequent cleanup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: temporary files and subsequent cleanup
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: [Moderator] Leopard Discussion Embargo Lifted at 6PM Pacific Time on Friday
  • Next by Date: Re: temporary files and subsequent cleanup
  • Previous by thread: Re: temporary files and subsequent cleanup
  • Next by thread: Re: temporary files and subsequent cleanup
  • Index(es):
    • Date
    • Thread