Skip to content

How to rename files in MemFS? #452

Closed
@pspot2

Description

@pspot2

Hi,

there doesn't seem to be a way to rename files in MemFS without copying them around. Looks like MemFS tries to apply os.rename() if the file can be seen by the OS (which is not the case for MemFS). The only remaining way is to use something like fs.move that duplicates the file before removing the old one. On systems with limited memory this obviously doesn't work. Example: a MemFS with a total size of 10 GB and a single file of 8 GB lying on it. How to rename this file?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions