Create and mount a virtual filesystem

1.2k Views Asked by At

This question doesn't sound trivial, but I'll give it a try.

What I need to do, is to create a virtual filesystem and mount it as if it was an hard drive. When my application starts, a new hard drive should appear in the list of available devices. Now, I need that drive to be virtual. In particular, I need to be able to generate the content in a dynamic way.

Basically, I would want to be able to:

  • import some magic library
  • register the callbacks for, like, list folder, get the content of this file at these bytes, and so on
  • run my program
  • a new drive appears, and when I do an ls, it's my program that answers that ls via a callback

Is this even possible? In principle, I should be able to simulate a drive, but I wouldn't even know where to start.

1

There are 1 best solutions below

0
On BEST ANSWER

On Linux FUSE library is built into the OS. On MacOS X there's OSXFUSE which is similar to FUSE on Linux.

On Windows there's CBFS Connect by our company, which offers its own API and a FUSE compatibility layer.

Mobile platforms (iOS, Android) neither offer such functions nor give a way to implement them.