TONT 34923 有关『文件系统穿隧』功能的传闻


One of the file system features you may find yourself surprised by is tunneling, wherein the creation timestamp and short/long names of a file are taken from a file that existed in the directory previously. In other words, if you delete some file “File with long name.txt” and then create a new file with the same name, that new file will have the same short name and the same creation time as the original file. You can read this KB article for details on what operations are sensitive to tunnelling.

文件系统中有一个功能可能会让你感到惊讶,这个功能叫做『穿隧』,即某文件的创建时间戳和短、长文件名都来自于该目录中之前存在过的文件。换句话说,如果删掉一个类似『File with logn name.txt』(译注:意为『具有长文件名的文件.txt』)这样的文件,然后新建一个具有相同名称的文件,那么新建的文件会与原有的文件具有相同的短文件名(译注:8.3格式的文件名)和相同的创建时间。你可以阅读这篇知识库文章(译注:KB172190,链接已失效)来了解有哪些操作受这种穿隧功能的影响。

Why does tunneling exist at all?


When you use a program to edit an existing file, then save it, you expect the original creation timestamp to be preserved, since you’re editing a file, not creating a new one. But internally, many programs save a file by performing a combination of save, delete, and rename operations (such as the ones listed in the linked article), and without tunneling, the creation time of the file would seem to change even though from the end user’s point of view, no file got created.


As another example of the importance of tunneling, consider that file “File with long name.txt”, whose short name is say “FILEWI~1.TXT”. You load this file into a program that is not long-filename-aware and save it. It deletes the old “FILEWI~1.TXT” and creates a new one with the same name. Without tunnelling, the associated long name of the file would be lost. Instead of a friendly long name, the file name got corrupted into this thing with squiggly marks. Not good.

有关穿隧功能的重要性,再来看另一个例子。假设有一个文件叫『File with long name.txt』,其对应的短文件名为『FILEWI~1.TXT』。现在在一个不支持长文件名的程序中加载它,然后保存,结果是程序删掉了旧的FILEWI~1.TXT,然后创建了一个具有相同文件名的新文件。没有穿隧功能的话,与文件相关联的长文件名就不见了(译注:如前所述,程序不支持长文件名,所以不可能处理与长文件名相关的事务)。现在文件原来漂亮的长文件名不见了,而是变成了一个带着波浪线的短文件名,这可不好。

But where did the name “tunneling” come from?

话说回来,『穿隧』这个名字是哪来的呢?(译注:File system tunneling 没有官方中文译名,此处译文仅供参考)

From quantum mechanics.


Consider the following analogy: You have two holes in the ground, and a particle is in the first hole (A) and doesn’t have enough energy to get out. It only has enough energy to get as high as the dotted line.


You get distracted for a little while, maybe watch the Super Bowl halftime show, and when you come back, the particle somehow is now in hole B. This is impossible in classical mechanics, but thanks to the wacky world of quantum mechanics, it is not only possible, but actually happens. The phenomenon is known as tunneling, because it’s as if the particle “dug a tunnel” between the two holes, thereby allowing it to get from one hole to another without ever going above the dotted line.


In the case of file system tunneling, it is information that appears to violate the laws of classical mechanics. The information was destroyed (by deleting or renaming the file), yet somehow managed to reconstruct itself on the other side of a temporal barrier.


The developer who was responsible for implementing tunneling on Windows 95 got kind of carried away with the quantum mechanics analogy: The fragments of information about recently-deleted or recently-renamed files are kept in data structures called “quarks”.

负责为 Windows 95 开发穿隧功能的开发者捎带着将量子力学的概念带了过来:刚刚删除或重命名过的文件的信息碎片,保存在了被成为『夸克』的数据结构中。


电子邮件地址不会被公开。 必填项已用*标注

 剩余字数 ( Characters available )

Your comment will be available after auditing.

Please DO NOT add any links in your comment, otherwise it would be identified as SPAM automatically and never be audited.