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



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

This email sent to [email protected]

Reply via email to