unix/
unix.rs

1use typed_path::{Component, UnixPath};
2
3fn main() {
4    let path = UnixPath::new(r"/path/to/file.txt");
5
6    for component in path.components() {
7        println!("{}", String::from_utf8_lossy(component.as_bytes()));
8    }
9}