Does DSOFile.OleDocumentProperties.Save modify file?

牧云@^-^@ 提交于 2019-12-13 04:48:01

问题


DSOFile.OleDocumentProperties.Save modifies metadata associated to a file on NTFS.

Does it modify the file itself, meaning that the checksum will change?
Or does it only modify some NTFS metadata about the file, but the checksum will remain the same?

More about DSOFile: KB, Technet

Credit: It was actually a self-interrogation by Ilmo within this question.


回答1:


It depends on the file format and the file system where the file is located.

If the file is an OLE format, the file itself will be modified since the properties are contained in the file. This will cause the file data to be modified and its size may change. Any file hash generator (such as CRC, MD5, SHA1, etc.) would produce different result, before and after one of the property is changed.

If the file is not an OLE format, all properties will be saved in one or more NTFS file streams, which are physically separate from the file data. This will cause a change on the file's last modification time, but it will not cause the file data to be modified nor changed in size. File hash generator would produce the same result, before and after one of the property is changed, assuming that the program does not take the file's last modification time and its file streams into account. In case of non NTFS file system, OLE document properties is not applicable on all files.



来源:https://stackoverflow.com/questions/13172949/does-dsofile-oledocumentproperties-save-modify-file

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