{"id":50844097,"url":"https://github.com/suhteevah/ntfs-rw","last_synced_at":"2026-06-14T08:05:25.667Z","repository":{"id":349728839,"uuid":"1199734540","full_name":"suhteevah/ntfs-rw","owner":"suhteevah","description":"no_std NTFS filesystem with read/write support in Rust","archived":false,"fork":false,"pushed_at":"2026-06-12T08:51:34.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-12T10:23:00.763Z","etag":null,"topics":["bare-metal","embedded","filesystem","no-std","ntfs","operating-system","osdev","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhteevah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T16:47:58.000Z","updated_at":"2026-05-30T06:06:56.000Z","dependencies_parsed_at":"2026-05-11T21:03:10.657Z","dependency_job_id":null,"html_url":"https://github.com/suhteevah/ntfs-rw","commit_stats":null,"previous_names":["suhteevah/ntfs-rw"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhteevah/ntfs-rw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fntfs-rw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fntfs-rw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fntfs-rw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fntfs-rw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhteevah","download_url":"https://codeload.github.com/suhteevah/ntfs-rw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhteevah%2Fntfs-rw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34313614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bare-metal","embedded","filesystem","no-std","ntfs","operating-system","osdev","rust"],"created_at":"2026-06-14T08:05:24.789Z","updated_at":"2026-06-14T08:05:25.654Z","avatar_url":"https://github.com/suhteevah.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ntfs-rw\n\n[![no_std](https://img.shields.io/badge/no__std-yes-blue)](https://rust-embedded.github.io/book/)\n[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT)\n\nA `no_std` NTFS filesystem implementation in Rust with read and write support.\n\nDesigned for bare-metal, embedded, and OS development environments where the standard library is not available. Only requires `alloc`.\n\n## Features\n\n- **Boot sector / BPB parsing** with full validation (OEM ID, signature, geometry)\n- **Master File Table (MFT)** entry parsing with Update Sequence Array (fixup) support\n- **Attribute parsing** for both resident and non-resident attributes\n- **Data run encoding/decoding** (mapping pairs) for non-resident data\n- **`$FILE_NAME` attribute** parsing with UTF-16LE filenames, timestamps, and namespace support (POSIX, Win32, DOS, Win32+DOS)\n- **B+ tree index traversal** for directory lookups (`$INDEX_ROOT` and `$INDEX_ALLOCATION`)\n- **`$UpCase` table** for case-insensitive filename comparison per the NTFS spec\n- **VCN-to-LCN mapping** for non-contiguous file data\n- **High-level API**: `read_file`, `write_file`, `mkdir`, `list_dir`\n- **Serialization support**: boot sector, MFT entries, data runs, and filenames can be written back to disk\n\n## Usage\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nntfs-rw = \"0.1\"\n```\n\nImplement the `BlockDevice` trait for your storage backend:\n\n```rust\nuse ntfs_rw::{NtfsFs, BlockDevice, NtfsError};\n\nstruct MyDisk {\n    // your storage backend (NVMe, virtio-blk, RAM disk, disk image, etc.)\n}\n\nimpl BlockDevice for MyDisk {\n    fn read_bytes(\u0026self, offset: u64, buf: \u0026mut [u8]) -\u003e Result\u003c(), NtfsError\u003e {\n        // Read buf.len() bytes from the partition starting at byte offset\n        todo!()\n    }\n\n    fn write_bytes(\u0026self, offset: u64, buf: \u0026[u8]) -\u003e Result\u003c(), NtfsError\u003e {\n        // Write buf to the partition starting at byte offset\n        todo!()\n    }\n\n    fn flush(\u0026self) -\u003e Result\u003c(), NtfsError\u003e {\n        // Optional: flush cached writes to storage\n        Ok(())\n    }\n}\n\nfn example(disk: MyDisk) -\u003e Result\u003c(), NtfsError\u003e {\n    // Mount the filesystem\n    let fs = NtfsFs::mount(disk)?;\n\n    // Read a file\n    let data = fs.read_file(b\"/path/to/file.txt\")?;\n\n    // Write a file (creates if not exists, overwrites if exists)\n    fs.write_file(b\"/output.txt\", b\"Hello, NTFS!\")?;\n\n    // Create a directory\n    fs.mkdir(b\"/new_directory\")?;\n\n    // List directory contents\n    let entries = fs.list_dir(b\"/\")?;\n    for entry in \u0026entries {\n        // entry.name, entry.is_directory, entry.size, etc.\n    }\n\n    Ok(())\n}\n```\n\n## Architecture\n\nThe crate is organized into focused modules:\n\n| Module | Description |\n|--------|-------------|\n| `boot_sector` | NTFS boot sector / BPB parsing and serialization |\n| `mft` | MFT entry parsing, fixup arrays, attribute iteration |\n| `attribute` | Attribute header parsing (resident and non-resident) |\n| `data_runs` | Data run (mapping pairs) encoding and decoding |\n| `filename` | `$FILE_NAME` attribute with UTF-16LE support |\n| `index` | B+ tree index structures for directory traversal |\n| `upcase` | `$UpCase` table for case-insensitive comparisons |\n| `readwrite` | High-level filesystem API (`NtfsFs`, `BlockDevice`) |\n\n## Limitations\n\nThis is a work-in-progress implementation. Known limitations:\n\n- **No journaling**: writes do not go through `$LogFile`\n- **No compression/encryption**: LZNT1 compressed and EFS encrypted attributes are detected but not decoded\n- **Limited write support**: growing files beyond their current allocation and resident-to-non-resident conversion are not yet implemented\n- **Directory index updates**: newly created files/directories are written to MFT but not yet inserted into the parent directory's B+ tree index\n- **No `$ATTRIBUTE_LIST` support**: files with attributes spanning multiple MFT entries are not handled\n\n## NTFS References\n\n- [Linux NTFS Documentation](https://flatcap.github.io/linux-ntfs/) -- detailed on-disk structure reference\n- [Microsoft MFT Documentation](https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table)\n\n## License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT License ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contributing\n\nContributions are welcome. Please open an issue or pull request on [GitHub](https://github.com/suhteevah/ntfs-rw).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fntfs-rw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhteevah%2Fntfs-rw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhteevah%2Fntfs-rw/lists"}