A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
Zio provides a simple, powerful, cross-platform filesystem abstraction for .NET with many built-ins filesystems.
netstandard2.0, netstandard2.1 and net8.0+IFileSystemnet10.0 async APIs via generated *Async file-system types and IAsyncEnumerable enumeration/search helpersIFileSystem.Watch method and the IFileSystemWatcher interfaceUPathPhysicalFileSystem to access the physical disks, directories and folders./mnt/c/Windows equivalent to C:\Windows)MemoryFileSystem to access a filesystem in memory:PhysicalFileSystem (including exceptions)FileShare.Read, FileShare.Write and FileShare.ReadWriteFile.Replace)ZipArchiveFileSystem to access zip archives:ZipArchive classFileShare.Read with ZipArchiveMode.ReadAggregateFileSystem providing a read-only filesystem aggregating multiple filesystem that offers a merged viewMountFileSystem to mount different filesystems at a specific mount point nameSubFileSystem to view a sub-folder of another filesystem as if it was a root / directoryReadOnlyFileSystem to interact safely with another filesystem in read-only modeFileSystemEntry, FileEntry and DirectoryEntry offering a similar API to their respective FileSystemInfo, FileInfo, DirectoryInfoAccessing a physical filesystem:
var fs = new PhysicalFileSystem();
foreach(var dir in fs.EnumerateDirectories("/mnt/c"))
{
// ...
}
Using an in-memory filesystem:
var fs = new MemoryFileSystem();
fs.WriteAllText("/temp.txt", "This is a content");
if (fs.FileExists("/temp.txt"))
{
Console.WriteLine("The content of the file:" + fs.ReadAllText("/temp.txt"))
}
Async APIs are available when targeting net10.0 through generated async file-system types such as MemoryFileSystemAsync. The following documentation provides more information about the API, generated async path, and how to use it.
The documentation is directly available as part of this repository in the /doc folder.
Zio is available as a NuGet package:
In order to build Zio, you need to install Visual Studio 2022 with the latest .NET 10 SDK so the net10.0 async target can compile.
This software is released under the BSD-Clause 2 license.
The logo is File by jeff from the Noun Project
Alexandre MUTEL aka xoofx
No open issues yet, or sync has not completed.