# `Path` Ratchet

[](https://crates.io/crates/path_ratchet)
[](https://github.com/TheAlgorythm/path-ratchet/actions?query=workflow%3ARust)
[](https://web.crev.dev/rust-reviews/crate/path_ratchet/)
Prevent path traversal attacks at type level.
```Rust
use std::path::PathBuf;
use path_ratchet::prelude::*;
let user_input = "/etc/shadow";
let mut filename = PathBuf::from("/tmp");
filename.push_component(SingleComponentPath::new(user_input).unwrap());
```