• 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: Best practice for creating a temporary file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practice for creating a temporary file


  • Subject: Re: Best practice for creating a temporary file
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 02 Sep 2014 13:17:59 -0700

> On Sep 2, 2014, at 10:45 AM, Kyle Sluder <email@hidden> wrote:
>
> .TemporaryItems doesn't get cleaned up automatically AFAIK, so I don't
> think you'll gain anything by trying to use it.

On my system right now there's nothing in it older than 2 days or so, so I suspect it does get cleaned up (at least on reboot?)



> On Sep 2, 2014, at 10:50 AM, email@hidden wrote:
>
> Probably NSURLSessionDownloadTask fits this requirement. It downloads the data to a temporary file which can be read or moved to a permanent location. The temporary file gets deleted as soon as control returns from the completion handler.


These aren't individual HTTP downloads; they're nested bodies within a MIME multipart HTTP response.

Also, I can't switch to NSURLSession anytime soon because it doesn't support runloop-based scheduling, so I'd have to rewrite a lot of quite complex code to switch it to NSOperationQueue.

—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


  • Follow-Ups:
    • Re: Best practice for creating a temporary file
      • From: Scott Ribe <email@hidden>
References: 
 >Best practice for creating a temporary file (From: Jens Alfke <email@hidden>)
 >Re: Best practice for creating a temporary file (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: My services in my own app
  • Next by Date: Re: Best practice for creating a temporary file
  • Previous by thread: Re: Best practice for creating a temporary file
  • Next by thread: Re: Best practice for creating a temporary file
  • Index(es):
    • Date
    • Thread