realpath-rs 0.2.0

A cross-platform Rust equivalent of python3's `os.path.realpath`
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 1 items with examples
  • Size
  • Source code size: 8.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 205.98 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • loggerheads-with-binary

realpath-rs

A cross-platform Rust equivalent of python3's os.path.realpath

Usage

use realpath::*; 
use std::path::PathBuf; 

let src = PathBuf::from("Cargo.toml");
let dest : PathBuf = realpath(&src)?; 
println!("{} -> {}", src, dest.display()); //Returns Cargo.toml -> /path/to/Cargo.toml on linux and Drive:\path\to\Cargo.toml on windows

//For windows 
let src = PathBuf::from(r"Doge.exe");
let dest : PathBuf = realpath_win(&src , false)?; 
println!("{}" , dest.display()); //Returns \\?\Drive:\path\to\Doge.exe
let dest : PathBuf = realpath_win(&src , true)?;
println!("{}" , dest.display()); //Returns Drive:\path\to\Doge.exe

//Inner functionality 
let dest = realpath_og(&src)?;
println!("{}" , dest.display()); //Returns /path/to/Cargo.toml on linux and \\?\Drive:\path\to\Cargo.toml on windows