Re: Least Expensive File Copy Method?
Re: Least Expensive File Copy Method?
- Subject: Re: Least Expensive File Copy Method?
- From: Matt Neuburg <email@hidden>
- Date: Sun, 1 Sep 2002 03:10:25 -0700
On Sat, 31 Aug 2002 22:44:08 -0600, Buzz Andersen <email@hidden> said:
>
I'm looking to deal with file copy operations that may involve large
>
numbers of files, large amounts of data, and a lot of time. Ideally,
>
I'm trying to limit the impact of such operations on the Finder and my
>
own application. To this end, I have detached an NSThread to allow the
>
operations to happen asynchronously, and this helps a lot in terms of
>
avoiding the dreaded "beach ball."
>
>
Even still, copying all of this data tends to have a very negative
>
impact on my Mac's responsiveness. Maybe this is unavoidable (now that
>
I think about it, I don't remember ever sitting around using Photoshop
>
while copying a gig worth of files through the Finder :-) ), but if
>
anyone knows of a better way (perhaps a more low-level method?) to do
>
the copy I'd like to know.
>
>
So far, I have tried these two methods:
>
>
The NSFileManager way:
>
>
[fileman copyPath: source toPath: destination handler: self];
>
>
The NSWorkspace way:
>
>
[workspace performFileOperation: NSWorkspaceCopyOperation source:
>
source destination: destination files: files tag: tag];
What if you create your own buffer and loop through each source file
copying and appending a small chunk at a time? m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.