Does DSOFile.OleDocumentProperties.Save modify fil

2019-09-05 09:06发布

问题:

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.



标签: ole dsofile