且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NTFS 备用数据流

更新时间:2022-11-02 23:14:07

来自我的脑海:NTFS 数据流 是在 Windows NT 4.0 中引入的,并且在所有后代中都存在(不包括 win-95 后代:98、Me).在 XP、Vista 和 Win 7 中,它们仍然存在.只要 Windows 版本支持 NTFS,它们就会支持文件流.他们将在很长一段时间内支持 NTFS.

From the top of my head: NTFS datastreams were introduced in Windows NT 4.0 and have been around in all descendants (excluding the win-95 descendants: 98, Me). In XP, Vista and Win 7 they're still around. As long as Windows versions support NTFS, they will support file streams. They will support NTFS for a long time to come.

您在问题中显示的页面上描述了您遇到的错误.type 命令不理解流.使用:

The error you have is described on the page you show in your question. The type command doesn't understand streams. Use:

more < 1013.pdf:Zone.Identifier

使用流

微软只有少数几个可以处理流的命令,实际上只有<>可以处理流,因此只能使用可以处理流的命令使用这些重定向运算符.我写了一篇关于备用数据流的几篇博文,介绍如何仍然只使用这些命令操作流.


Working with streams

Microsoft only has a handful commands that work with streams, in fact, only <, > work with streams, and thus only commands can be used that can work with these redirect operators. I wrote a couple of blog posts on alternate datastreams on how you can still manipulate streams with only these commands.

Streams 只会和那些被设计用来处理它们的程序一起工作,仅仅是因为它们需要被特殊对待(比较结点,也是 NTFS 的一个特性,但驱动程序隐藏了细节,程序不需要做任何事情特别:他们只是认为连接点是一个真实的文件).

Streams will only work with programs that are designed to work with them, simply because they need to be treated specially (compare junction points, also a feature of NTFS, but the driver hides the details and programs do not need to do anything special: they just consider the junction point a real file).

当您尝试使用 start filename:streamname 打开文件流时,程序显示非法文件名"或找不到文件"之类的信息,并且您确定流名称正确,那么很可能该程序不支持流.我注意到记事本、写字板和 Word/Excel 可以正确处理流,但 Word 和 Excel 认为这些文件很危险.以下是一些实验,您可以尝试.

When you try to open a file stream using start filename:streamname and a program says something like "illegal filename" or "file not found", and you are positive that the stream name is correct, then it's likely that the program does not support streams. I noticed that Notepad, Wordpad and Word/Excel work correctly with streams, though Word and Excel consider the files dangerous. Here are some experiments you may try.

注意:您似乎认为备用数据流很奇怪.它们很奇怪,因为它们是如此隐藏,但许多主要文件系统(HFS、NSS)都有它,而且这个概念可以追溯到 80 年代初.事实上,最初将流添加到 NTFS 是为了与其他文件系统进行互操作.

NOTE: you seem to consider alternate data streams odd. They are odd because they are so hidden, but many major file system (HFS, NSS) have it and the concept dates back to the early 80s. In fact, originally the streams were added to NTFS for interoperability with other filesystems.