• 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: Moving vs copying file resulting from NSURLSession download task
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Moving vs copying file resulting from NSURLSession download task (From: Rick Mann <email@hidden>)

  • Prev by Date: Mysterious SSL failures in iOS 9 simulator (but not on real devices)
  • Next by Date: Restoring context with NSURLSession background tasks
  • Previous by thread: Moving vs copying file resulting from NSURLSession download task
  • Next by thread: Mysterious SSL failures in iOS 9 simulator (but not on real devices)
  • Index(es):
    • Date
    • Thread