12

I want to program a virtual file system in Windows with Python.

That is, a program in Python whose interface is actually an "explorer windows". 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.

What is the easiest way to do that?

4
  • 4
    First of all. Make a complete list of what you want to achive. Then pick the first item in that list and if you have a doubt on that specific item you could ask here for a solution. As it is right now this question is too broad. Commented Aug 25, 2009 at 1:19
  • 1
    I agree with Oscar. It doesn't seem as though you are building a file system at all, but rather a window that acts like and explorer window, but that can read and write to other existing file systems, such as an FTP site (remotely), or a compressed or encrypted volume (features of zip files, or encryption libraries). Commented Aug 25, 2009 at 1:24
  • 6
    I wrote I am building (or want to build) a virtual file system Commented Aug 25, 2009 at 1:35
  • 1
    Any luck implementing it?! Is there a github repo ??? :) Commented Sep 2, 2015 at 17:13

5 Answers 5

10

While perhaps not quite ripe yet (unfortunately I have no first-hand experience with it), pywinfuse looks exactly like what you're looking for.

Sign up to request clarification or add additional context in comments.

Comments

4

Does it need to be Windows-native? There is at least one protocol which can be both browsed by Windows Explorer, and served by free Python libraries: FTP. Stick your program behind pyftpdlib and you're done.

Comments

4

Have a look at Dokan a User mode filesystem for 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.

Comments

2

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. 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. 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

Comments

2

You might be interested in PyFilesystem;

A filesystem abstraction layer for Python

PyFilesystem is an abstraction layer for filesystems. 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. You can write platform-independent code to work with local files, that also works with any of the supported filesystems (zip, ftp, S3 etc.).

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.

3 Comments

The OP looked for the opposite, I believe -- for a way to expose his data as a filesystem.
@EugeneMayevski'EldoSCorp That's what PyFilesystem's expose submodules do - my answer could probably benefit from some verbosity, I'll expand it later on
@EugeneMayevski'EldoSCorp I added some more text – I didn't realize the homepage doesn't mention the expose functions, since I found PyFilesystem by explicitly searching for something with Python and Dokan...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.