zio icon indicating copy to clipboard operation
zio copied to clipboard

A single file system via MemoryFileSystem?

Open cs-util opened this issue 5 years ago • 1 comments

Would it be the correct approach to use MemoryFileSystem if I want to create a virtual file system that is persisted to disk in a single file?

At some point I would then have to take the data from the MemoryFileSystem and dump it to disc, is that possible or is there a better way to achieve this?

cs-util avatar Apr 18 '20 11:04 cs-util

Would it be the correct approach to use MemoryFileSystem if I want to create a virtual file system that is persisted to disk in a single file?

Not really. MemoryFileSystem is really meant for in-memory manipulation. What might be similar to what you are looking for is to copy the memory file system to another file system which would store it differently (e.g ZipFileSystem, or TarFileSystem...etc.), or to work with these filesystems storage directly.

Otherwise, you can always dump a MemoryFileSystem to a PhysicalFileSystem with the latest 0.8.0 version (CopyTo extension on a filesystem)

xoofx avatar Apr 19 '20 12:04 xoofx