J
Just Me
I'm trying to write some code to determine if two copies of a file
stored on two different drives are identical. I thought this would be
fairly easy by checking the file length and the modified date. In doing
this I found that if I copy a file to a different location on the same
drive, the modified date stays the same. But if I copy the file to a
different drive the modified date is changed by a second or two. I've
tried this numerous times with different variations and always get the
same results - copy a file to the same drive, same modified date; copy
it to a different drive and you now you have different modified dates.
I see the same results whether I check it using FileDateTime or
DateLastModified. In Windows Explorer you don't notice this because it
doesn't show the seconds.
So now my questions...
Does this happen to everyone else too?
Why would Microsoft do this? (I know - a stupid question.)
How can I determine if files on different drives are the same when the
modified date changes even when the file hasn't been modified? I can't
rely on file length alone because it is possible to change a file and
have its length remain the same. I can't do a comparison of the file
contents because there are many files to check and it would probably
take forever.
Any suggestions would be greatly appreciated.
Tony
stored on two different drives are identical. I thought this would be
fairly easy by checking the file length and the modified date. In doing
this I found that if I copy a file to a different location on the same
drive, the modified date stays the same. But if I copy the file to a
different drive the modified date is changed by a second or two. I've
tried this numerous times with different variations and always get the
same results - copy a file to the same drive, same modified date; copy
it to a different drive and you now you have different modified dates.
I see the same results whether I check it using FileDateTime or
DateLastModified. In Windows Explorer you don't notice this because it
doesn't show the seconds.
So now my questions...
Does this happen to everyone else too?
Why would Microsoft do this? (I know - a stupid question.)
How can I determine if files on different drives are the same when the
modified date changes even when the file hasn't been modified? I can't
rely on file length alone because it is possible to change a file and
have its length remain the same. I can't do a comparison of the file
contents because there are many files to check and it would probably
take forever.
Any suggestions would be greatly appreciated.
Tony