xoofx / zio

A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
BSD 2-Clause "Simplified" License
827 stars 61 forks source link

A single file system via MemoryFileSystem? #49

Open cs-util opened 4 years ago

cs-util commented 4 years ago

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?

xoofx commented 4 years ago

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)