@@ -517,11 +517,20 @@ impl FileTypeExt for fs::FileType {
517
517
}
518
518
}
519
519
520
- /// Creates a new file symbolic link on the filesystem.
520
+ /// Creates a new symlink to a non-directory file on the filesystem.
521
521
///
522
522
/// The `link` path will be a file symbolic link pointing to the `original`
523
523
/// path.
524
524
///
525
+ /// The `original` path should not be a directory or a symlink to a directory,
526
+ /// otherwise the symlink will be broken. Use [`symlink_dir`] for directories.
527
+ ///
528
+ /// This function currently corresponds to [`CreateSymbolicLinkW`][CreateSymbolicLinkW].
529
+ /// Note that this [may change in the future][changes].
530
+ ///
531
+ /// [CreateSymbolicLinkW]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw
532
+ /// [changes]: io#platform-specific-behavior
533
+ ///
525
534
/// # Examples
526
535
///
527
536
/// ```no_run
@@ -537,11 +546,20 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
537
546
sys:: fs:: symlink_inner ( original. as_ref ( ) , link. as_ref ( ) , false )
538
547
}
539
548
540
- /// Creates a new directory symlink on the filesystem.
549
+ /// Creates a new symlink to a directory on the filesystem.
541
550
///
542
551
/// The `link` path will be a directory symbolic link pointing to the `original`
543
552
/// path.
544
553
///
554
+ /// The `original` path must be a directory or a symlink to a directory,
555
+ /// otherwise the symlink will be broken. Use [`symlink_file`] for other files.
556
+ ///
557
+ /// This function currently corresponds to [`CreateSymbolicLinkW`][CreateSymbolicLinkW].
558
+ /// Note that this [may change in the future][changes].
559
+ ///
560
+ /// [CreateSymbolicLinkW]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw
561
+ /// [changes]: io#platform-specific-behavior
562
+ ///
545
563
/// # Examples
546
564
///
547
565
/// ```no_run
0 commit comments