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
> rm...@latencyzero.com (mailto:rm...@latencyzero.com)
>  
>  
>  
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list (Macnetworkprog@lists.apple.com 
> (mailto:Macnetworkprog@lists.apple.com))
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/macnetworkprog/adkapx%40gmail.com
>  
> This email sent to adk...@gmail.com (mailto:adk...@gmail.com)  



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to