How can I check if a file has alternate data streams?
Look at the Win32 API FindFirstStreamW()
and FindNextStreamW()
:
Enumerates the first stream of stream type
::$DATA
in the specified file or directory.
Continues the search for the stream started by the previous function call
FindFirstStreamW
.
However, the file or directory may have other stream types besides ::$DATA
those not listed in the Win32 API, they are internal to NTFS itself.
See MSDN for details.
To list streams not $DATA
, you would need to read the filesystem directly, like BackupRead()
and BackupSeek()
. See Enumerating Alternate Data Streams in CodeProject for details .
source to share