Copying large files with progress indicator
Copying large files with progress indicator
- Subject: Copying large files with progress indicator
- From: Mike Abdullah <email@hidden>
- Date: Mon, 31 Jul 2006 17:04:14 +0100
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:
This email sent to email@hidden