use strict_path::PathBoundary;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let requested_file: String = std::env::args()
.nth(1)
.unwrap_or_else(|| "hello.txt".to_owned());
let tmp_dir = tempfile::tempdir()?;
PathBoundary::<()>::try_new(&tmp_dir)?
.strict_join(&requested_file)?
.write("hello from a strict path\n")?;
let bytes_read = PathBoundary::<()>::try_new(&tmp_dir)?
.strict_join(&requested_file)?
.read()?
.len();
println!("One-liner PathBoundary: read {bytes_read} bytes");
Ok(())
}