Re: verifying copied folders

From: Kevin J Prince (kevin_at_princ7.demon.co.uk)
Date: 01/31/05


Date: Mon, 31 Jan 2005 20:01:55 +0000

Thanks for the reply,

I was rather hoping there was a pre-ordained routine or two ready to do
the job.

My thoughts were to run some sort of algorithm on each file just giving
me a checksum value and then checking the two checksums.

I'm rusty as hell in programming, so need as much help as possible
here...

The idea of reading writing and checking the written stuff in chunks has
already left me cold. How can I do that on an open file.

What I suppose I forgot to mention was that some of the files will be up
to 2 megs in size. So if I have to open and close then open to read and
check then close again, its going to be a long winded process....

Shame there is no Compare or the like in VB.

OK, as always, any further help will be much appreciated, as will any
other ideas as to the process's of the above... problem.

Regards
Kevin

In message <Ou5msx8BFHA.2104@TK2MSFTNGP14.phx.gbl>, Karl E. Peterson
<karl@mvps.org> writes
>Kevin J Prince wrote:
>> How do I copy a whole folder (with sub-folders and files in each
>> sub-folder), then verify each of the folders and files therein, then
>> delete those folders from the original.
>>
>> Any suggestions gratefully received.
>>
>> The overall project includes selecting drive, folder and possibly sub
>> folder, then copying to a different drive, verifying the data then
>> deleting the original.
>
>Sounds like one of the scariest projects I can imagine undertaking! There are
>literally more potential problems there than I could begin to
>enumerate. However,
>*you* will have to. <g>
>
>I'd start slow. Work on enumerating every file from the "root" folder on down.
>You'll probably want to build an array containing all those fully-qualified
>filenames. In the process of that enumeration, keep track of each folder you
>encounter, as you'll need to recreate these on the destination. Then,
>start working
>on copy algorithms. For total control, you'll need to do them
>yourself, block of
>bytes at a time. Then, of course, you'll want to read back what you wrote, and
>compare to the original. I wouldn't begin thinking of actual deletion
>(which will be
>a relative breeze!) until you've exhausted yourself in all these other
>efforts. But
>this is the general idea.
>
>In short, break this down into each of the hundred or so discrete
>pieces, and tackle
>them in a logical order. If/when you have troubles with any specific
>part, holler!
>There's plenty of experience here.

-- 
Kevin J Prince


Relevant Pages

  • Re: Algorithm ideas
    ... > I'm updating some engineering software at work (moving it off of the ... > just copying the old algorithm, which is accurate, but slow and ... > Imagine you have a bunch of data that is in a tree structure. ... > a top-level folder that contains other folders, ...
    (comp.programming)
  • Re: read only folder on Windows
    ... As I already gave you the algorithm, I fail to see what would you ... Microsoft MVP, MCSD ... is more clear to understand access control for folder? ... "Alexander Nickolov" wrote: ...
    (microsoft.public.vc.language)
  • Re: Algorithm ideas
    ... > just copying the old algorithm, which is accurate, but slow and ... > a top-level folder that contains other folders, ... > it's value is the sum of the documents plus the sum of the values of ... Then your cached sizes are always in sync. ...
    (comp.programming)
  • Algorithm ideas
    ... I'm updating some engineering software at work (moving it off of the ... just copying the old algorithm, which is accurate, but slow and ... a top-level folder that contains other folders, ... sub-folders can, in turn, contain other sub-folders and documents. ...
    (comp.programming)
  • Re: Rolling back folders delete using VBA
    ... created at run time) with same sub folder structure. ... if we come accross an error while deleting a file from original location. ... Dim oSubFolder As Object ... Dim oFile As Object ...
    (microsoft.public.excel.programming)

Loading