fuse

FUSE directory wrapper skeleton


FUSE can make virtual directories. Is there a FUSE basic skeleton public implementation ?

For example, fuse will mount directory a/ and reflect changes to b/. When virtual file a/x.txt is created, then real file b/x.txt is created, etc.

It appears to be useless, but I then could use that as a base code and then do my modifications.


Solution

  • You have exactly that as one of the libfuse included examples: https://github.com/libfuse/libfuse/blob/master/example/passthrough.c

    A good practice is as you say to copy the code of an example most relevant for you and expand from there.

    See also related question about mirroring a file system: FUSE lib passthrough.c example. Where is it mirrors my / exactly?