Trait filepath::FilePath [−][src]
An extension trait for std::fs::File providing a path method.
Required Methods
fn path(&self) -> Result<PathBuf>
Returns the path of this file.
The path might be wrong for example after moving a file.
Platform-specific behavior
This function currently uses /proc/self/fd/ on Linux, fcntl with F_GETPATH on macOS
and GetFinalPathNameByHandle on Windows.
Examples
use std::fs::File; use std::io; use filepath::FilePath; fn main() -> io::Result<()> { let file = File::open("some_file")?; let path = file.path()?; Ok(()) }
Implementations on Foreign Types
impl FilePath for File[src]
impl FilePath for File