[][src]Function junction::delete

pub fn delete<P: AsRef<Path>>(junction: P) -> Result<()>

Deletes a junction reparse point from the specified file or directory.

N.B. Only works on NTFS.

This function does not delete the file or directory. Also it does nothing if the junction point does not exist.

Example

use std::io;
use std::path::Path;
fn main() -> io::Result<()> {
    let tmpdir = tempfile::tempdir()?;
    let target = tmpdir.path().join("target");
    let junction = tmpdir.path().join("junction");
    create(&target, &junction)?;
    delete(&junction)
}