Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copying large files with progress indicator



Apologies if this topic had been covered fully before - I have searched the lists and Google for over an hour and not found anything useful!

Basically, I want to copy some large files to another disk on my system. At present, I'm using:

	[NSFileManager copyPath:toPath:handler]

Obviously, this ties up the app until it is done, offering me no decent solution for progress indication or canceling the copy if needed.

So, I figure I need to run the process in a separate thread. However, NSFileManager isn't thread safe :(
I figure that I can put it in a big lock, but then there's no decent way of finding out how far the task is progressing.


If I am copying lots of small files, then NSFileManager offers a fileManager:willProcessPath: method, but for copying a few large files, that is next to useless!

So basically what I am asking is, what is the best strategy for copying large files in Cocoa and providing full progress feedback and the ability to cancel the operation? (Without resorting to an NSTask also!)

Mike.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.