Function std::fs::read_link [] [src]

pub fn read_link<P: AsRef<Path>>(path: P) -> Result<PathBuf>

Reads a symbolic link, returning the file that the link points to.

Errors

This function will return an error on failure. Failure conditions include reading a file that does not exist or reading a file that is not a symbolic link.

Examples

fn main() { use std::fs; fn foo() -> std::io::Result<()> { let path = try!(fs::read_link("a.txt")); Ok(()) } }
use std::fs;

let path = try!(fs::read_link("a.txt"));