问题
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