3

I recently added two 2TB WD Caviar Black SATA drives to an external enclosure with USB 2.0 . Since then I have to deal with occasional file corruption when I copy files with Explorer from my local C: drive to the external drives. I either end up with files that cannot be read anymore, or with files that can be read but cannot be copied once they are on one of the external HD's. All drives have been tested and are okay. Did some googling now and found various hints on the web that it might be a problem with the shell of my Vista Home Premium 32bit (all updates applied).

To circumvent this file corruption I am looking for the safest way to copy files from one NTFS file system to another (preserving all file properties), including a CRC32 check - if possible without involving the Shell. Can anyone point me to a code snippet which shows how to do that in Delphi 2007 Pro?

studiohack
  • 13,477
Phil
  • 41

3 Answers3

3

Your drives are probably formatted with NTFS.

A drive can only be formatted for NTFS if it is not marked for "quick removal".

Which means that you should properly shutdown your machine before turning off or removing your NTFS drive.

For copy, you can use RoboCopy; it does not have a verify though, but it has a very fast backup mode (which you can use when you are logged on as Administrator and have elevated to your Administrator token).

XXCOPY has verify, and a good RoboCopy/XXCOPY comparison is here.

For my backups, I use a RAID system with active checking. That means it regularly checks all the RAID volumes for integrity. Not cheap, but worth the money.

1

In case someone is interested: I found some interesting Delphi code on Earl F. Glynn's site at

http://www.efg2.com/Lab/Mathematics/FileCheck.htm

Phil
  • 41
0

The file corruption disappeared since I re-enabled UAC on my system. I've read reports about this before (although they were very vague), and it seems as if it did the trick. Thanks again for all responses! Much appreciated.

Phil
  • 41