直接从文件系统获取文件校验和,而不是显式计算它
我猜测典型的文件系统倾向于保留其管理的每个文件的某种校验和/CRC/哈希,因此它可以检测文件损坏。
这个猜测正确吗?如果是的话,有没有办法访问它?
我主要对 Windows 和 NTFS 感兴趣,但也欢迎对其他平台的评论...语言在这一点上并不重要,但如果可能的话,我想避免使用汇编程序。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,看来我的要求是不可能的。
顺便说一句,这也在这里讨论过:在 Windows 文件系统中,每个文件是否有一个预先计算的哈希值?
OK, it appears that what I'm asking is impossible.
BTW, this was also discussed here: In Windows file systems, is there a pre-computed hash for each file?
在大多数文件系统和存储硬件中,它们会保留分配单元的校验和,而不是完整文件。
一般来说,硬件中的校验和可能根本无法访问,并且文件系统集群的校验和对于绝大多数情况来说并不是很有用,因此如果可能的话也很难获得。
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.