Zio
A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
Install / Use
/learn @xoofx/ZioREADME
Zio

<img align="right" width="160px" height="160px" src="https://raw.githubusercontent.com/xoofx/zio/main/img/zio.png">
Zio provides a simple, powerful, cross-platform filesystem abstraction for .NET with many built-ins filesystems.
Features
- Compatible with
netstandard2.0,netstandard2.1andnet8.0+ - API providing all operations provided by the regular System.IO API (e.g File.Move, Directory.Delete... etc.)
- Allowing atomic filesystem operations (e.g File.Replace...)
- A simple interface abstraction
IFileSystem - Supports for filesystem watcher through the
IFileSystem.Watchmethod and theIFileSystemWatcherinterface- For all builtin filesystems (aggregates, memory...etc.)
- All paths are normalized through a lightweight uniform path struct
UPath - Multiple built-ins filesystems:
PhysicalFileSystemto access the physical disks, directories and folders.- With uniform paths, this filesystem on Windows is working like on a Windows Subsystem Linux (WSL), by remapping drives to mount directory (e.g path
/mnt/c/Windowsequivalent toC:\Windows)
- With uniform paths, this filesystem on Windows is working like on a Windows Subsystem Linux (WSL), by remapping drives to mount directory (e.g path
MemoryFileSystemto access a filesystem in memory:- Trying to be 100% compatible with a true
PhysicalFileSystem(including exceptions) - Efficient concurrency with a per node (file or directory) locking mechanism
- A safe hierarchical locking strategy (following Unix kernel recommendations for directory locking)
- Support for
FileShare.Read,FileShare.WriteandFileShare.ReadWrite - Internally support for filesystem atomic operations (
File.Replace)
- Trying to be 100% compatible with a true
ZipArchiveFileSystemto access zip archives:- This filesystem is a wrapper around the
ZipArchiveclass - It can work in case sensitive and case insensitive mode
- Support for
FileShare.ReadwithZipArchiveMode.Read
- This filesystem is a wrapper around the
- On top of these final filesystem, you can compose more complex filesystems:
AggregateFileSystemproviding a read-only filesystem aggregating multiple filesystem that offers a merged viewMountFileSystemto mount different filesystems at a specific mount point nameSubFileSystemto view a sub-folder of another filesystem as if it was a root/directoryReadOnlyFileSystemto interact safely with another filesystem in read-only mode
- Higher level API similar to
FileSystemEntry,FileEntryandDirectoryEntryoffering a similar API to their respectiveFileSystemInfo,FileInfo,DirectoryInfo
Usage
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.
Documentation
The documentation is directly available as part of this repository in the /doc folder.
Download
Zio is available as a NuGet package:
Build
In order to build Zio, you need to install Visual Studio 2022 with latest .NET 9.0 SDK
License
This software is released under the BSD-Clause 2 license.
Credits
The logo is File by jeff from the Noun Project
Author
Alexandre MUTEL aka xoofx
Related Skills
node-connect
328.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
328.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.0kCommit, push, and open a PR
