Skip to content

Feature request: Add an option to mount a memory fs to the OS filesystem #578

@embeddedpenguin

Description

@embeddedpenguin

The problem I'm trying to solve is this: I am trying to add a dry-run option to a program that git clones a couple repos and modifies them. To add a dry-run option, I need to simulate a fs or mock the fs calls. The best approach to this, in my opinion, is to make a virtual fs in ram and perform options there, leaving the original fs untouched. I tried doing this using pyfilesystem2's memory fs, but there seems to be no way to mount this to the host OS. I then tried using an OSFS, but it seems like all of those changes are persistent on disk. I did eventually get this working using a tmpfs, but it's still not ideal because it side skirts the simulating at the desired location, meaning any permissions/ownership issues wouldn't be seen from a dry-run.

It seems like pyfilesystem2 is the best library capable of solving this issue, but I'm struggling to figure out how to get pyfilesystem2 to do it. The only way I could really think of to do this is by adding an option to mount a memory fs to the OS's filesystem. If this feature can't be added, any advice on using pyfilesystem to solve this issue would be greatly appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions