{"id":13671943,"url":"https://github.com/ColinFinck/ntfs","last_synced_at":"2025-04-27T18:31:59.804Z","repository":{"id":40245409,"uuid":"413157983","full_name":"ColinFinck/ntfs","owner":"ColinFinck","description":"An implementation of the NTFS filesystem in a Rust crate, usable from firmware level up to user-mode.","archived":false,"fork":false,"pushed_at":"2024-08-06T17:38:16.000Z","size":1049,"stargazers_count":528,"open_issues_count":5,"forks_count":30,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T22:38:09.672Z","etag":null,"topics":["no-std","ntfs","rust","windows"],"latest_commit_sha":null,"homepage":"","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/ColinFinck.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}},"created_at":"2021-10-03T18:07:17.000Z","updated_at":"2025-03-26T07:44:13.000Z","dependencies_parsed_at":"2024-11-06T06:46:51.129Z","dependency_job_id":null,"html_url":"https://github.com/ColinFinck/ntfs","commit_stats":{"total_commits":136,"total_committers":3,"mean_commits":"45.333333333333336","dds":0.07352941176470584,"last_synced_commit":"853712047404727d67ae07a2a6331aec67476276"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fntfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fntfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fntfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fntfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinFinck","download_url":"https://codeload.github.com/ColinFinck/ntfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187377,"owners_count":21549629,"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":["no-std","ntfs","rust","windows"],"created_at":"2024-08-02T09:01:22.585Z","updated_at":"2025-04-27T18:31:58.546Z","avatar_url":"https://github.com/ColinFinck.png","language":"Rust","readme":"\u003cimg align=\"right\" src=\"img/ntfs.svg\"\u003e\n\n# ntfs Rust crate\n\n[![crates.io](https://img.shields.io/crates/v/ntfs)](https://crates.io/crates/ntfs)\n[![docs.rs](https://img.shields.io/docsrs/ntfs)](https://docs.rs/ntfs)\n![license: MIT OR Apache-2.0](https://img.shields.io/crates/l/ntfs)\n\n*by Colin Finck \u003c\u003ccolin@reactos.org\u003e\u003e*\n\nA low-level NTFS filesystem library implemented in Rust.\n\n[NTFS](https://en.wikipedia.org/wiki/NTFS) is the primary filesystem in all versions of Windows (since Windows NT 3.1 in 1993).\nThis crate is geared towards the NTFS 3.x versions used in Windows 2000 up to the current Windows 11.\nHowever, the basics are expected to be compatible to even earlier versions.\n\nThe crate is `no_std`-compatible and therefore usable from firmware-level code up to user-mode applications.\n\n## ntfs-shell\n![ntfs-shell demo](img/ntfs-shell.gif)\n\nThe `ntfs-shell` example comes with this crate to demonstrate all library features.\nUse it to explore the internal structures of an NTFS filesystem at any detail level, even of your running Windows partition.\nNo artificial security restrictions will block you from accessing files and folders, extracting their data or Alternate Data Streams.\nThe filesystem is opened read-only, so you can safely browse even a mounted filesystem without worrying about data corruption.\nThat is also helpful to get an idea of the Windows NTFS driver, e.g. to find out when its lazy writer actually updates the data on disk.\n\nI originally wrote `ntfs-shell` for myself to comfortably develop the library in user-mode before running the code in production in kernel-mode.\n\nTo build `ntfs-shell`, just clone this repo and call\n\n```\ncargo build --example ntfs-shell --all-features\n```\n\nTo run it, pass the path to an NTFS image (on all operating systems) or to a partition (like `\\\\.\\C:`, on Windows only with administrative privileges) to the resulting `ntfs-shell` binary.\n\nCalling `help` gives you a list of all supported commands.\n`help COMMAND` details the syntax of that command.\n\nMost commands that take a filename also take an NTFS File Record Number (if prepended by `/`).\nThis File Record Number may be decimal or hexadecimal (if prepended by `0x`).\nSome examples:\n\n```\nfileinfo Windows\nfileinfo /146810\nfileinfo /0x23d7a\n```\n\n## Library Features\n* For the impatient: Convenience functions to treat NTFS like any other filesystem and just read files and directories using `Read`/`Seek` traits.\n  At your option, you may also explore the filesystem at any detail level.\n* Reading arbitrary resident and non-resident attributes, attributes in Attribute Lists, and attributes connected over multiple Attribute List entries, including sparse attribute data.\n  All of this together enables reading file data and Alternate Data Streams of any size and on-disk structure.\n* Iterating over a flattened \"data-centric\" view of the NTFS Attributes, abstracting away any nested Attribute List.\n* Efficiently finding files in a directory, adhering to the filesystem's $Upcase Table for case-insensitive search.\n* In-order iteration of directory contents at O(1).\n* Leveraging Rust's typesystem to handle the various types of NTFS indexes in a typesafe way.\n* Error propagation through a custom `NtfsError` type that implements `Display`.\n  Where it makes sense, variants have additional fields to pinpoint any error to a specific location.\n* Full functionality even in a `no_std` environment with `alloc`.\n* No usage of `unsafe` anywhere. Checked arithmetic where needed.\n* Platform and endian independence.\n\n## Not yet supported\n* Any write support\n* Caching for better performance\n* Compression\n* Encryption\n* Journaling\n* Quotas\n* Reparse Points\n* Security Descriptors\n\n## Examples\nThe following example dumps the names of all files and folders in the root directory of a given NTFS filesystem.  \nThe list is directly taken from the NTFS index, hence it's sorted in ascending order with respect to NTFS's understanding of case-insensitive string comparison.\n\n```rust,no_run\nlet mut ntfs = Ntfs::new(\u0026mut fs).unwrap();\nlet root_dir = ntfs.root_directory(\u0026mut fs).unwrap();\nlet index = root_dir.directory_index(\u0026mut fs).unwrap();\nlet mut iter = index.entries();\n\nwhile let Some(entry) = iter.next(\u0026mut fs) {\n    let entry = entry.unwrap();\n    let file_name = entry.key().unwrap();\n    println!(\"{}\", file_name.name());\n}\n```\n\nCheck out the [docs](https://docs.rs/ntfs), the tests, and the supplied `ntfs-shell` application for more examples on how to use the `ntfs` library.\n\n## License\nThis crate is licensed under either of\n\n * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n * [MIT license](http://opensource.org/licenses/MIT)\n\nat your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n## Further Resources\n* [flatcap.github.io linux-ntfs documentation](https://flatcap.github.io/linux-ntfs/ntfs/)\n* [ntfs-3g driver](https://github.com/tuxera/ntfs-3g)\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinFinck%2Fntfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FColinFinck%2Fntfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FColinFinck%2Fntfs/lists"}