Skip to content
Advertisement

How to create a “fake filesystem” that forwards system calls to my program?

I would like to write a tool that can be used to mount archives such as tar, tgz, zip, 7z, etc. to some directory for as long as it’s running, such that I can then open it with whatever file manager I want.

To do this, I would somehow need to make a fake filesystem that forwards system calls such as opening and reading files to my program. How would I did this? Would I have to make my own filesystem driver, or does a library for this already exist?

Advertisement

Answer

FUSE is what you’re looking for, in principle. One implementation of the archive-mounting you’re looking for is/was archive mount, but I am unsure how well it is maintained.

Advertisement