realbasic-nug
[Top] [All Lists]

Re: CopyFileTo Speed

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: CopyFileTo Speed
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Tue, 30 Jul 2002 12:41:19 -0700
At 9:06 PM +0200 7/30/02, Roland Voegtli wrote:

I have a quick question about the speed of FolderItem.CopyFileTo.
I want to copy around 50 megs in 6 files at startup of the
app (backing up database files, if user desires). If I copy
these files on OS X 10.1.5 (PB G4/550) the Finder needs around
10 seconds to do the job.

If I use "sourceFile.CopyFileTo targetFolder", the compiled
app requires for the same job 110 seconds. And the HD is making
noises like it's moving bazillions of terrabytes...

Is this method supposed to be so slow

Yes, we copy everything 10 times just so people buy faster computers.  ;)

No, seriously though, the Finder's copy code is highly optimized (especially in OS X) at all sorts of low levels that we don't have access to. We're just using the ordinary file-copying API calls that Apple provides to us. So I'm not surprised that the Finder is faster, but I am surprised at what a large difference you're seeing. Such a large difference may indicate a bug; I suggest you report it with REALbugs.

Meanwhile, as a work-around, consider using an embedded AppleScript or AppleEvents to have the Finder copy the files for you.

HTH,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout           REAL Software, Inc.                |
|    joe at realsoftware dot com       http://www.realsoftware.com        |
`------------------------------------------------------------------'


<Prev in Thread] Current Thread [Next in Thread>