How to compare 2 volumes and list modified files?

后端 未结 5 1075
遇见更好的自我
遇见更好的自我 2021-01-14 11:21

I have 2 hard-disk volumes(one is a backup image of the other), I want to compare the volumes and list all the modified files, so that the user can select the ones he/she wa

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 11:41

    Without knowing more details about what you're trying to do here, it's hard to say. However, some tips about what I think you're trying to achieve:

    • If you're only concerned about NTFS volumes, I suggest looking into the USN / change journal API's. They have been around since 2000. This way, after the initial inventory you can only look at changes from that point on. A good starting point for this, though a very old article is here: http://www.microsoft.com/msj/0999/journal/journal.aspx
    • Also, utilizing USN API's, you could omit the hash step and just record information from the journal yourself (this will become more clear when/if you look into said APIs)
    • The first time through comparing a drive's contents, utilize a hash such as SHA-1 or MD5.
    • Store hashes and other such information in a database of some sort. For example, SQLite3. Note that this can take up a huge amount of space itself. A quick look at my audio folder with 40k+ files would result in ~750 megs of MD5 information.

提交回复
热议问题