@@ -543,6 +543,16 @@ impl FileTypeExt for fs::FileType {
543543/// Ok(())
544544/// }
545545/// ```
546+ ///
547+ /// # Limitations
548+ ///
549+ /// Windows treats symlink creation as a [privileged action][symlink-security],
550+ /// therefore this function is likely to fail unless the user makes changes to
551+ /// their system to permit symlink creation. Users can try enabling Developer
552+ /// Mode, granting the `SeCreateSymbolicLinkPrivilege` privilege, or running
553+ /// the process as an administrator.
554+ ///
555+ /// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
546556#[ stable( feature = "symlink" , since = "1.1.0" ) ]
547557pub fn symlink_file < P : AsRef < Path > , Q : AsRef < Path > > ( original : P , link : Q ) -> io:: Result < ( ) > {
548558 sys:: fs:: symlink_inner ( original. as_ref ( ) , link. as_ref ( ) , false )
@@ -572,6 +582,16 @@ pub fn symlink_file<P: AsRef<Path>, Q: AsRef<Path>>(original: P, link: Q) -> io:
572582/// Ok(())
573583/// }
574584/// ```
585+ ///
586+ /// # Limitations
587+ ///
588+ /// Windows treats symlink creation as a [privileged action][symlink-security],
589+ /// therefore this function is likely to fail unless the user makes changes to
590+ /// their system to permit symlink creation. Users can try enabling Developer
591+ /// Mode, granting the `SeCreateSymbolicLinkPrivilege` privilege, or running
592+ /// the process as an administrator.
593+ ///
594+ /// [symlink-security]: https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links
575595#[ stable( feature = "symlink" , since = "1.1.0" ) ]
576596pub fn symlink_dir < P : AsRef < Path > , Q : AsRef < Path > > ( original : P , link : Q ) -> io:: Result < ( ) > {
577597 sys:: fs:: symlink_inner ( original. as_ref ( ) , link. as_ref ( ) , true )
0 commit comments