{"id":25992521,"url":"https://github.com/gasinfinity/nzfat","last_synced_at":"2025-03-05T14:19:59.274Z","repository":{"id":280619284,"uuid":"940635831","full_name":"GasInfinity/nzfat","owner":"GasInfinity","description":"A very generic and configurable FAT12/16/32 implementation with VFAT support.","archived":false,"fork":false,"pushed_at":"2025-03-04T11:07:48.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T12:22:46.347Z","etag":null,"topics":["fat","filesystem","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/GasInfinity.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-28T14:24:33.000Z","updated_at":"2025-03-04T12:07:16.000Z","dependencies_parsed_at":"2025-03-04T12:22:49.959Z","dependency_job_id":"63ba8a8f-7076-407e-b634-00ee69109166","html_url":"https://github.com/GasInfinity/nzfat","commit_stats":null,"previous_names":["gasinfinity/zfat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GasInfinity%2Fnzfat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GasInfinity%2Fnzfat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GasInfinity%2Fnzfat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GasInfinity%2Fnzfat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GasInfinity","download_url":"https://codeload.github.com/GasInfinity/nzfat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039925,"owners_count":20061947,"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":["fat","filesystem","zig","zig-package"],"created_at":"2025-03-05T14:19:58.473Z","updated_at":"2025-03-05T14:19:59.260Z","avatar_url":"https://github.com/GasInfinity.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡ nzfat (WIP)\nA very generic and configurable FAT12/16/32 implementation library with VFAT support written in zig.\nAlmost all the features are configurable, from long filename support (and the max number of characters it supports) to the maximum supported FAT type (12/16/32).\n\n[![asciicast](https://asciinema.org/a/Zf1LmR1KpfLKj7KxOFWCuUIPE.svg)](https://asciinema.org/a/Zf1LmR1KpfLKj7KxOFWCuUIPE)\n\n  \n## ❓ Usage\nThe library is not mature enough for production usage, but if you still want to use this, here's some little info:\n  \nThe `FatFilesystem` type only needs two arguments, the block device context and its configuration. Some methods change their signature depending on the configuration and all methods require the block context to be passed to it. This library never stores the passed block device anywhere.\n\nFor example, mounting a FAT filesystem might be done like this:\n```zig\nconst nzfat = @import(\"nzfat\");\nconst Fat = nzfat.FatFilesystem(...);\n// ...\nvar fat_ctx = try Fat.mount(\u0026blk);\n// See zfat.MountError\n```\n\nTo traverse the directory entries you have `directoryIterator` and `directoryIteratorContext` at your disposal:\n```zig\n// TODO: Explain why directoryIteratorContext is sometimes needed for long filenames.\nvar dir_it = fat_ctx.directoryIterator(fat_ctx.getRoot());\ndefer dir_it.deinit();\n\nwhile (try dir_it.next(\u0026blk)) |entry| : (entries += 1) {\n    // Do something with entry \n}\n```\n\nAs searching for a specific entry in a directory is very common, `searchEntry` and `searchEntryContext` abstract away the case-insensitive nature of the filesystem:\n```zig\n// TODO: Explain that for long filenames a case-insensitive comparison function must be provided as its out of scope for this project\nif(try fat_ctx.searchEntry(\u0026blk, handle, name)) |entry| {\n    // Do something with the entry we found...\n}\n```\n\n## 📝 TODO\n\n### Small TODO's\n- [x] Searching for 1 free entry in a directory (a.k.a: Short filename only)\n- [x] Searching for a free cluster linearly\n- [x] Deletion of files and directories\n- [x] Short filename alternatives when using a VFAT `FatFilesystem`\n- [x] Searching for N free clusters for file and directory creation\n- [x] Allocate new directory entries if no entries found and not in root (FAT12/16 only)\n- [ ] Creation of directory entries with LFN entries if needed\n- [ ] Searching for N free entries in a directory\n- [x] API to allocate clusters for files\n- [ ] API to modify dates and times and attributes in entries\n\n### Big TODO's\n- [ ] Implement some sort of I/O cache? Or leave it to the BlockDevice implementation?\n- [ ] Some sort of cache strategy for FAT entries if requested.\n- [ ] Reorganize/rename and API Freeze\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasinfinity%2Fnzfat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgasinfinity%2Fnzfat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasinfinity%2Fnzfat/lists"}