Reputation: 3022
Is there a way in Delphi to check if a file has any Alternate Data Streams?
Upvotes: 3
Views: 3262
Reputation: 596497
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.
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.
Upvotes: 6