• 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: Identifying complete size of file when transfer is in progress
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying complete size of file when transfer is in progress


  • Subject: Re: Identifying complete size of file when transfer is in progress
  • From: Roland King <email@hidden>
  • Date: Sat, 16 Nov 2013 08:43:23 +0800

On 16 Nov, 2013, at 8:10 am, Devarshi Kulshreshtha <email@hidden> wrote:

> Hi Jens,
>
> Regarding:
>
> You haven’t stated where these files are coming from. Is this a network
> download? In that case you can use NSURLConnection’s delegate methods to
> find the size of the file and watch the download progress. If it’s some
> other API, check whether it has progress monitoring.
>
>>> user will be copying these files directly through iTunes.
>
>


Ah .. I do this. I have an NSFilePresenter which is watching a directory. When I get notice there's a new file I (on a queue) perform a coordinated read on it using NSFileCoordinator. The read block only gets called after the file has been completely written. Yes I get multiple callbacks on the file presenter as the file grows, but it doesn't matter, it's very easy to figure out I'm waiting for the coordinated read to occur and throw them away.

I have no idea what the apple sample DirectoryWatcher uses, I rolled my own, but I'm guessing it uses file coordination. I'm getting much in the habit now of thinking, every single time I do any kind of file operation, whether I should use file coordination on it.




_______________________________________________

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


References: 
 >Identifying complete size of file when transfer is in progress (From: Devarshi Kulshreshtha <email@hidden>)
 >Re: Identifying complete size of file when transfer is in progress (From: Jens Alfke <email@hidden>)
 >Re: Identifying complete size of file when transfer is in progress (From: Devarshi Kulshreshtha <email@hidden>)

  • Prev by Date: Re: Identifying complete size of file when transfer is in progress
  • Next by Date: Re: Deleting 20000 files in applicationWillTerminate
  • Previous by thread: Re: Identifying complete size of file when transfer is in progress
  • Next by thread: Deleting 20000 files in applicationWillTerminate
  • Index(es):
    • Date
    • Thread