about summary refs log tree commit diff
path: root/library/std/src/os
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2024-02-27 18:54:18 -0300
committerChris Denton <chris@chrisdenton.dev>2024-02-27 19:27:09 -0300
commit228347878ebd45d5cb7e6f424bad18eb0b92543a (patch)
tree2f38a11f1df6c248f2289e15e9178f633b2557e7 /library/std/src/os
parent1e4f9e302c63ee126a4db8ec2cf3fa396dc74d52 (diff)
downloadrust-228347878ebd45d5cb7e6f424bad18eb0b92543a.tar.gz
rust-228347878ebd45d5cb7e6f424bad18eb0b92543a.zip
Implement junction_point
Diffstat (limited to 'library/std/src/os')
-rw-r--r--library/std/src/os/windows/fs.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/library/std/src/os/windows/fs.rs b/library/std/src/os/windows/fs.rs
index e9d7a13e9d5..27947d91c99 100644
--- a/library/std/src/os/windows/fs.rs
+++ b/library/std/src/os/windows/fs.rs
@@ -620,3 +620,15 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
 pub fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
     sys::fs::symlink_inner(original.as_ref(), link.as_ref(), true)
 }
+
+/// Create a junction point.
+///
+/// The `link` path will be a directory junction pointing to the original path.
+/// If `link` is a relative path then it will be made absolute prior to creating the junction point.
+/// The `original` path must be a directory or a link to a directory, otherwise the junction point will be broken.
+///
+/// If either path is not a local file path then this will fail.
+#[unstable(feature = "junction_point", issue = "121709")]
+pub fn junction_point<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io::Result<()> {
+    sys::fs::junction_point(original.as_ref(), link.as_ref())
+}