如何检查文件是否具有备用数据流? [英] How to check if a file has Alternate Data Streams?

查看:86
本文介绍了如何检查文件是否具有备用数据流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi中是否可以检查文件是否具有任何备用数据流?

解决方案

看看Win32 API FindFirstStreamW() FindNextStreamW () 函数:


枚举第一个流: :$ DATA 在指定文件或目录中的流类型。



继续从先前调用 FindFirstStreamW 函数开始的流搜索。


但是,文件或目录可能具有 :: $ DATA 以外的其他流类型,这些类型在Win32 API,它们是NTFS本身的内部。



有关更多详细信息,请参见MSDN。

>

使用视频流



文件流



要枚举非 $ DATA 流,您必须阅读直接使用文件系统,例如使用 BackupRead( ) BackupSeek() 。有关详细信息,请参见CodeProject上的枚举备用数据流。 / p>

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

解决方案

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.

这篇关于如何检查文件是否具有备用数据流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆