views:

27

answers:

3

Hi all,

My app Windows forms .NET in Win XP copy files pdfs in shared network folder in a server win 2003.

Admin user in Win2003 detects some corrupt files pdfs, in that shared folder.

I want check if a fileis copied right in shared folder

Andre Krijen says me the best way is to create a MD5Hash of original file. When the file is copied, verify the MD5Hash file of the copied one with the original one.

I have big pdf files.

apply md5 hash about big file, any performance problem ??

If I only check (without generate md5 hash) Length of files (original and copied) ??

Thanks in advanced.

+1  A: 

I think the MD5 checking should be a separate app running on the server so that you application doesn't have to open the copy on the shared folder to check the MD5.

Raj
There are many clients, App Winforms winxp, that copies files in a server 2003 (shared folder in network). Windows Service in Server reads files. For check MD5 I need original file and copied file, therefore I need check afteer copy file. Thanks.
alhambraeidos
+1  A: 

Install a MD5 checker on each server and make it a local process so you don't have to use bandwidth to recheck the Hash.

you can use MD5sums as a command line option or create your own worker app.

Glennular
There are many clients, App Winforms winxp, that copies files in a server win2003 (shared folder in network). Windows Service in Server reads files for insert in database. For check MD5 I need original file and copied file, therefore I need check afteer copy file. Thanks
alhambraeidos
+1  A: 

You can check the length of the files to quickly determine if they are different, but an identical length doesn't say that the content of the files is identical.

To really determine if the files are identical or not, you have to compare every single byte in the files. To send the files again just to compare them is of course not practical, but sending the MD5 hash of the file is.

If you want to compare the files you have to read the entire files, there is no way around that. The MD5 hash at least saves you a lot of network traffic.

Guffa