junction-verbatim 1.3.0

library for working with NTFS junctions (fork with verbatim prefix fix)
Documentation

Documentation Crates.io

junction-verbatim

This is a fork of tesuji/junction with a fix for verbatim prefix handling.

Library for working with NTFS junctions.

As opposed to symlinks, junction does not require administrator privileges during creation. (However starting with Windows 10 Insiders build 14972, symlinks can be created without needing to elevate the console as administrator)^1.

Quoted from Computer Hope:

A junction, also called an NTFS junction point, is a feature of the NTFS file system. It is pointer to a directory on the local volume, similar to a symlink. It can be accessed through the Windows GUI in addition to the Windows command line. Junction points were first introduced with Windows 2000 and NTFS 3.0, and are supported in all subsequent versions of Windows.

What's fixed in this fork

This fork fixes an issue where junction::create() would silently fail when passed paths containing the Windows verbatim prefix (\\?\), which are commonly produced by std::fs::canonicalize() on Windows. See issue #30 for details.

Example that now works:

let target = std::fs::canonicalize(&target_dir)?;  // Returns \\?\C:\...
let link = std::fs::canonicalize(&link_parent)? .join("junc");

// This now works correctly instead of creating a broken junction
junction::create(&target, &link)?;

Minimal Supported Rust versions

Specified in the rust-version field in Cargo.toml.

All relevant references

License

All the code in this repository is released under the MIT License, for more information, please read COPYRIGHT file.