如何在 Windows 中编写自己的“文件系统”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1962624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:38:44  来源:igfitidea点击:

How can I write my own 'filesystem' within Windows?

c++windowsfilesystems

提问by Null

I've recalled using little 'filesystems' before that basically provided an interface to something else. For example, I believe there was a GMail filesystem that created an entry in My Computer and could be used like any other drive on your local computer. How can I go about implementing something like this in C++? Thank you!

我记得之前使用过小的“文件系统”,这基本上提供了其他东西的接口。例如,我相信有一个 GMail 文件系统在“我的电脑”中创建了一个条目,并且可以像本地计算机上的任何其他驱动器一样使用。我怎样才能在 C++ 中实现这样的东西?谢谢!

采纳答案by blwy10

Try Dokan. It's like FUSE, except for Windows. I think there are certain limitations to namespace extensions, like they cannot be accessed from the command line, but I'm really not sure as of now.

试试多。它就像 FUSE,除了 Windows。我认为命名空间扩展有一些限制,比如不能从命令行访问它们,但我现在真的不确定。

回答by Nicolás

Writing an actual file-system involves writing a driver; which means kernel-mode code (scary stuff) and paying forgetting the IFS DDK. (edit: looks like they don't charge for it anymore)

编写实际的文件系统涉及编写驱动程序;这意味着内核模式代码(可怕的东西)和支付获取IFS DDK。(编辑:看起来他们不再收费了)

What you probably want is a “namespace extension”. Try this: The Complete Idiot's Guide to Writing Namespace Extensions - CodeProject

您可能想要的是“命名空间扩展”。试试这个:编写命名空间扩展的完整白痴指南 - CodeProject

回答by Tarydon

This may be a starting point to extending NTFS in the way that the GMail filesystem used to do: Windows NT reparse points.

这可能是以 GMail 文件系统过去所做的方式扩展 NTFS 的起点:Windows NT 重新分析点

回答by UltraInstinct

The GMail Filesystem is just the name given; it is not any filesystem as such. It is just a namespace extension for Windows Explorer that links with the GMail account of yours!

GMail 文件系统只是给定的名称;它不是任何文件系统。它只是与您的 GMail 帐户链接的 Windows 资源管理器的命名空间扩展!

I dont know exactly what you are trying to do, but in anyway, I believe, the following link will be of some use to you:

我不确切知道您要做什么,但无论如何,我相信以下链接对您有用:

http://msdn.microsoft.com/en-us/magazine/cc188741.aspx

http://msdn.microsoft.com/en-us/magazine/cc188741.aspx

回答by Eugene Mayevski 'Callback

Just as a reference: virtual drives can be created using our Callback File Systemproduct, which is a supported, documented and maintained solution.

仅供参考:可以使用我们的回调文件系统产品创建虚拟驱动器,这是一个受支持、记录和维护的解决方案。

回答by Sam Aersixb9 Strelitz

I was thinking of this too, perhaps some example code ? (email me if i forget plz ;p doin sdk now)

我也在考虑这个,也许是一些示例代码?(如果我忘记了请给我发电子邮件;p 现在做 sdk)

I'm thinking of a similar filesystem that would plug in as a driver and allow dynamic 'soft raid' on larger files mostly by putting them on more than one disk, perhaps some compression options and 'smart' filters to toggle usage in high disk space low usage and other situations more effectively, with status controls and indicators as a normalish program too

我正在考虑一个类似的文件系统,它将作为驱动程序插入并允许对较大文件进行动态“软突袭”,主要是将它们放在多个磁盘上,也许是一些压缩选项和“智能”过滤器来切换高磁盘的使用更有效地空间低使用率和其他情况,状态控制和指示器也作为正常程序

Seems like I would load the driver kit, then i want the file writing event, and am mostly replacing fopen and similar functions automatically as an intermediate driver with a little windows network driver experience

似乎我会加载驱动程序套件,然后我想要文件写入事件,并且主要是自动替换 fopen 和类似功能作为具有一点 Windows 网络驱动程序经验的中间驱动程序

I also heard good things about developing on a virtual machine for less crashing and more debugging

我还听说了在虚拟机上开发以减少崩溃和更多调试的好处

Also perhaps more metainfo on some or all files, including files in special folders with options too, including maybe both fast and simple (obfuscated and/or symmetic key) encryption options on folder, specified, all, letter, etc, or whatever, or the slower version and maybe integrated and optional (also profitable) online cvs-like diff style backups that mostly target changes to hot files for online backup at intervals and prices, mostly perhaps with matching keyboard events and might even be useful as simply a keylogging online backup service that is reasonably secure too

也可能是关于某些或所有文件的更多元信息,包括带有选项的特殊文件夹中的文件,包括文件夹、指定、全部、字母等的快速和简单(混淆和/或对称密钥)加密选项,或其他,或较慢的版本,可能是集成的和可选的(也有利可图的)类似 cvs 的在线 diff 样式备份,主要针对热文件的更改,以按时间间隔和价格进行在线备份,主要可能与匹配的键盘事件一起使用,甚至可能仅用作在线键盘记录备份服务也相当安全

while avoiding common files like windows files or the normal stuff in the 'programs' directory that can be copied easily with pirate tools, unlike all of your documents.

同时避免使用诸如 windows 文件之类的常见文件或“程序”目录中的普通文件,这些文件可以使用盗版工具轻松复制,这与您的所有文档不同。