Re: Best practice for creating a temporary file
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