How to check if a file has Alternate Data Streams?

江枫思渺然 提交于 2019-12-12 15:29:24

问题


Is there a way in Delphi to check if a file has any Alternate Data Streams?


回答1:


Have a look at the Win32 API FindFirstStreamW() and FindNextStreamW() functions:

Enumerates the first stream with a ::$DATA stream type in the specified file or directory.

Continues a stream search started by a previous call to the FindFirstStreamW function.

However, a file or directory may have other stream types besides ::$DATA, which are not enumerable in the Win32 API, they are internal to NTFS itself.

See MSDN for more details.

Using Streams

File Streams

To enumerate non-$DATA streams, you would have to read the filesystem directly, such as with BackupRead() and BackupSeek(). See Enumerating Alternate Data Streams on CodeProject for details on that.



来源:https://stackoverflow.com/questions/44270479/how-to-check-if-a-file-has-alternate-data-streams

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