Trait assert_fs::fixture::SymlinkToFile [−][src]
pub trait SymlinkToFile {
fn symlink_to_file<P>(&self, target: P) -> Result<(), FixtureError>
where
P: AsRef<Path>;
}
Expand description
Create a symlink to the target
Required methods
fn symlink_to_file<P>(&self, target: P) -> Result<(), FixtureError> where
P: AsRef<Path>,
fn symlink_to_file<P>(&self, target: P) -> Result<(), FixtureError> where
P: AsRef<Path>,
Create a symlink to the target
Examples
use assert_fs::prelude::*;
let temp = assert_fs::TempDir::new().unwrap();
let real_file = temp.child("real_file");
real_file.touch().unwrap();
temp.child("link_file").symlink_to_file(real_file.path()).unwrap();
temp.close().unwrap();