Re: Moving vs copying file resulting from NSURLSession download task
Re: Moving vs copying file resulting from NSURLSession download task
- Subject: Re: Moving vs copying file resulting from NSURLSession download task
- From: Adam Kaplan <email@hidden>
- Date: Fri, 14 Aug 2015 21:27:44 -0400
You can move the file. It is actually documented as such in the URL Loading System Programming Guide, under Downloading Files:
> URLSession:downloadTask:didFinishDownloadingToURL:
> provides your app with the URL to a temporary file where the downloaded content is stored.
>
> Important: Before this method returns, it must either open the file for reading or move it to a permanent location. When this method returns, the temporary file is deleted if it still exists at its original location.
— adam
On Friday, August 14, 2015 at 4:39 PM, Rick Mann wrote:
> I wrote code that downloads hundreds of files in an NSURLSession. For each one, it moves it on the file system to the right location.
>
> Example code from Apple and elsewhere online shows the file being copied, not moved.
>
> However, my code seems to work. Is this safe/acceptable?
>
> Thanks,
>
> --
> Rick Mann
> email@hidden (mailto:email@hidden)
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list (email@hidden (mailto:email@hidden))
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden (mailto:email@hidden)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden