简体   繁体   中英

How to check if a file has Alternate Data Streams?

Delphi中有没有办法检查文件是否有任何备用数据流?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM