Getting a file checksum directly from the filesystem instead of calculating it explicitly

依然范特西╮ 提交于 2019-12-10 14:55:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!