{"id":17024075,"url":"https://github.com/purifetchi/nano.vfs","last_synced_at":"2026-04-28T21:04:09.445Z","repository":{"id":121887063,"uuid":"312550220","full_name":"purifetchi/Nano.VFS","owner":"purifetchi","description":"Simple modular in-memory virtual file system.","archived":false,"fork":false,"pushed_at":"2020-11-14T13:13:48.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T21:48:23.198Z","etag":null,"topics":["csharp","dotnet","vfs"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purifetchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-11-13T10:56:05.000Z","updated_at":"2023-11-01T13:55:49.000Z","dependencies_parsed_at":"2023-12-14T14:47:39.167Z","dependency_job_id":null,"html_url":"https://github.com/purifetchi/Nano.VFS","commit_stats":null,"previous_names":["purifetchi/nano.vfs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purifetchi%2FNano.VFS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purifetchi%2FNano.VFS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purifetchi%2FNano.VFS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purifetchi%2FNano.VFS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purifetchi","download_url":"https://codeload.github.com/purifetchi/Nano.VFS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245000649,"owners_count":20545092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","vfs"],"created_at":"2024-10-14T07:24:22.909Z","updated_at":"2026-04-28T21:04:04.425Z","avatar_url":"https://github.com/purifetchi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nano.VFS\nNano.VFS is a simple and modular implementation of an in-memory virtual file system. It allows you to create custom entry wrappers that mount into a centralized VFS class, meaning that you can mix different storage formats.\n\n# Provided VFS entry backends\n\n- OSFileEntry (Can mount directories and files from the FS)\n- ZipFileEntry (Can mount directories and files from ZIP archives)\n\n# Usage\n\n**Mounting a zip archive**\n```cs\n// Create a new VirtualFileSystem instance\nvar vfs = new VirtualFileSystem();\n\n// Create a file stream for the zip archive and open it with System.IO.Compression's ZipArchive\nvar fileStream = new FileStream(\"archive.zip\", FileMode.Open);\nvar archive = new ZipArchive(fileStream, ZipArchiveMode.Read);\n\n// Add every entry from the archive into the VFS\n// This already creates the folder structure\nforeach (var entry in archive.Entries)\n{\n\tvfs.Add(entry);\n}  \n```\n\n**Mounting files from the filesystem**\n```cs\nvar path = \"C://\";\n\n// Create a new VirtualFileSystem instance\nvar vfs = new VirtualFileSystem();\n\n// Iterate over every single file in the directory, recursively\nforeach (var file in Directory.GetFiles(path, \"*\", SearchOption.AllDirectories))\n{\n\t// Remove the actual root path part from the given path\n\tvar relative = file.Replace(path, \"\");\n\tvfs.Add(file, relative);\n}\n```\n\n**Get all the files in the VFS**\n```cs\nforeach (var file in vfs.GetAllEntries())\n{\n\t// Write out the path of every file\n\tConsole.WriteLine($\"{file.Path}\");\n}\n\n```\n\n**Get all the files in a directory**\n```cs\nforeach (var file in vfs.GetEntriesInDirectory(\"\\\\SomeDirectory\"))\n{\n\tConsole.WriteLine($\"{file.Name}\");\n}\n```\n\n**Read a file**\n```cs\nvar byteArray = vfs.ReadFile(\"\\\\SomeDirectory\\\\SomeFile.txt\");\nvar text = vfs.ReadFileAsString(\"\\\\SomeDirectory\\\\SomeFile.txt\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurifetchi%2Fnano.vfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurifetchi%2Fnano.vfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurifetchi%2Fnano.vfs/lists"}