MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / create_symlink

Function create_symlink

crates/hyperqueue/src/common/utils/fs.rs:16–24  ·  view source on GitHub ↗
(symlink_path: &Path, target: &Path)

Source from the content-addressed store, hash-verified

14}
15
16pub fn create_symlink(symlink_path: &Path, target: &Path) -> crate::Result<()> {
17 if symlink_path.exists() {
18 log::debug!("Symlink {} exists, removing", symlink_path.display());
19 std::fs::remove_file(symlink_path)?;
20 }
21 log::debug!("Creating new symlink: {}", symlink_path.display());
22 std::os::unix::fs::symlink(target, symlink_path)?;
23 Ok(())
24}
25
26pub fn get_current_dir() -> PathBuf {
27 std::env::current_dir().expect("Cannot get current working directory")

Callers 1

createMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected