简体   繁体   English

使用Python在Windows中编写虚拟文件系统的最简单方法

[英]easiest way to program a virtual file system in windows with Python

I want to program a virtual file system in Windows with Python. 我想用Windows编写Windows中的虚拟文件系统。

That is, a program in Python whose interface is actually an "explorer windows". 也就是说,Python中的一个程序,其界面实际上是一个“资源管理器窗口”。 You can create & manipulate file-like objects but instead of being created in the hard disk as regular files they are managed by my program and, say, stored remotely, or encrypted or compressed or versioned, or whatever I can do with Python. 您可以创建和操作类似文件的对象,但不是作为常规文件在硬盘中创建,而是由我的程序管理,比如远程存储,加密或压缩或版本化,或者我可以用Python做什么。

What is the easiest way to do that? 最简单的方法是什么?

虽然可能尚未成熟(不幸的是我没有第一手经验),但pywinfuse看起来与你正在寻找的完全一样。

Have a look at Dokan a User mode filesystem for Windows. 看看Dokan是Windows的用户模式文件系统。 There are Ruby, .NET (and Java by 3rd party) bindings available, and I don't think it'll be difficult to write python bindings either. 有Ruby,.NET(和第三方Java)绑定可用,我认为编写python绑定也不困难。

Does it need to be Windows-native? 它需要是Windows原生的吗? There is at least one protocol which can be both browsed by Windows Explorer, and served by free Python libraries: FTP. 至少有一个协议可以由Windows资源管理器浏览,并由免费的Python库提供服务:FTP。 Stick your program behind pyftpdlib and you're done. 坚持你的程序在pyftpdlib后面,你已经完成了。

You might be interested in PyFilesystem ; 您可能对PyFilesystem感兴趣;

A filesystem abstraction layer for Python Python的文件系统抽象层

PyFilesystem is an abstraction layer for filesystems. PyFilesystem是文件系统的抽象层。 In the same way that Python's file-like objects provide a common way of accessing files, PyFilesystem provides a common way of accessing entire filesystems. 与Python的类文件对象提供访问文件的常用方式相同,PyFilesystem提供了访问整个文件系统的常用方法。 You can write platform-independent code to work with local files, that also works with any of the supported filesystems (zip, ftp, S3 etc.). 您可以编写与平台无关的代码来处理本地文件,这些代码也适用于任何支持的文件系统(zip,ftp,S3等)。

What the description on the homepage does not advertise is that you can then expose this abstraction again as a filesystem, among others SFTP, FTP (though currently disfunct , probably fixable ) and dokan ( dito ) as well as fuse . 主页上没有做广告的描述是,你可以再次这个抽象作为文件系统公开 ,其中包括SFTP,FTP(虽然目前不适用 ,可能是可修复的 )和dokandito )以及融合

If you are trying to write a virtual file system (I may misunderstand you) - I would look at a container file format. 如果您正在尝试编写虚拟文件系统(我可能会误解您) - 我会查看容器文件格式。 VHD is well documented along with HDI and (embedded) OSQ. VHD与HDI和(嵌入式)OSQ一起被充分记录。 There are basically two things you need to do. 基本上你需要做两件事。 One is you need to decide on a file/container format. 一个是你需要决定文件/容器格式。 After that it is as simple as writing the API to manipulate that container. 之后,就像编写API来操作该容器一样简单。 If you would like it to be manipulated over the internet, pick a transport protocol then just write a service (would would emulate a file system driver) that listens on a certain port and manipulates this container using your API 如果您希望通过互联网进行操作,请选择传输协议,然后编写一个服务(将模拟文件系统驱动程序),该服务侦听某个端口并使用您的API操作此容器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为我的 python 程序创建令牌系统的最简单方法是什么? [等候接听] - What is the easiest way to create a token system for my python program? [on hold] 使用Python编辑系统特定配置文件的最简单,最佳方法是什么? - What is the easiest and best way to edit the system specific config file using Python? 在python中将数据结构持久化到文件的最简单方法? - Easiest way to persist a data structure to a file in python? 使用 Python 拆分 JSON 文件的最简单方法 - Easiest way to split JSON file using Python 在 Python 中创建 rtf 文件的最简单方法? - Easiest way to create an rtf file in Python? 导出Python程序以在另一台计算机上运行的最简单最快的方法? - Easiest & fastest way to export a Python program to run on another computer? 在Python程序中包装canvas标签和javascript的最简单方法? - Easiest way to wrap a canvas tag + javascript in a Python program? 暂停命令行python程序的最简单方法? - easiest way to pause a command-line python program? 编写具有Django数据库功能访问权限的Python程序的最简单方法 - Easiest way to write a Python program with access to Django database functionality 使用Windows 7按计划触发python脚本的最简单方法是什么? - What is the easiest way to trigger a python script on schedule using Windows 7?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM