My app Windows forms .NET in Windows XP copy files pdfs in shared network folder in a server Windows 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)?
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.