问题
I'm guessing that a typical filesystem tends to keep some kind of checksum/CRC/hash of every file it manages, so it can detect file corruption.
Is that guess correct? And if yes, is there a way to access it?
I'm primarily interested in Windows and NTFS, but comments on other platforms would be welcome as well... Language is unimportant at this point, but I'd like to avoid assembler if possible.
Thanks.
回答1:
OK, it appears that what I'm asking is impossible.
BTW, this was also discussed here: There is in Windows file systems a pre computed hash for each file?
回答2:
In the majority of filesystems and the storage hardware they would keep checksums of allocation units, not full files.
The checksums in the hardware are probably not accessible at all in general, and the checksum of the filesystem clusters would not be very useful for the great majority of cases so would be difficult to get, if possible.
来源:https://stackoverflow.com/questions/7812258/getting-a-file-checksum-directly-from-the-filesystem-instead-of-calculating-it-e