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.
.NET 4.6+
, netstandard2.0
, netstandard2.1
and net7.0
IFileSystem
IFileSystem.Watch
method and the IFileSystemWatcher
interface
UPath
PhysicalFileSystem
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.ReadWrite
File.Replace
)ZipArchiveFileSystem
to access zip archives:
ZipArchive
classFileShare.Read
with ZipArchiveMode.Read
AggregateFileSystem
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
, DirectoryInfo
Accessing 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"))
}
The following documentation provides more information about the API 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 latest .NET 7.0
This software is released under the BSD-Clause 2 license.
The logo is File
by jeff from the Noun Project
Alexandre MUTEL aka xoofx