win-desktop-utils 0.5.7

Windows desktop helpers for shell, shortcuts, app data, elevation, and single-instance Rust apps
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let first = std::env::current_dir()?.join("temp-delete-me-a.txt");
    let second = std::env::current_dir()?.join("temp-delete-me-b.txt");
    std::fs::write(&first, "temporary file")?;
    std::fs::write(&second, "temporary file")?;

    win_desktop_utils::move_paths_to_recycle_bin([&first, &second])?;

    println!("sent to recycle bin: {}", first.display());
    println!("sent to recycle bin: {}", second.display());

    Ok(())
}