@@ -699,7 +699,7 @@ pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
699
699
/// Given a path, query the file system to get information about a file,
700
700
/// directory, etc.
701
701
///
702
- /// This function will traverse soft links to query information about the
702
+ /// This function will traverse symbolic links to query information about the
703
703
/// destination file.
704
704
///
705
705
/// # Examples
@@ -811,31 +811,40 @@ pub fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<(
811
811
fs_imp:: link ( src. as_ref ( ) , dst. as_ref ( ) )
812
812
}
813
813
814
- /// Creates a new soft link on the filesystem.
814
+ /// Creates a new symbolic link on the filesystem.
815
815
///
816
- /// The `dst` path will be a soft link pointing to the `src` path.
816
+ /// The `dst` path will be a symbolic link pointing to the `src` path.
817
817
///
818
818
/// # Examples
819
819
///
820
820
/// ```
821
821
/// use std::fs;
822
822
///
823
823
/// # fn foo() -> std::io::Result<()> {
824
- /// try!(fs::soft_link ("a.txt", "b.txt"));
824
+ /// try!(fs::symlink ("a.txt", "b.txt"));
825
825
/// # Ok(())
826
826
/// # }
827
827
/// ```
828
828
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
829
- pub fn soft_link < P : AsRef < Path > , Q : AsRef < Path > > ( src : P , dst : Q ) -> io:: Result < ( ) > {
829
+ pub fn symlink < P : AsRef < Path > , Q : AsRef < Path > > ( src : P , dst : Q ) -> io:: Result < ( ) > {
830
830
fs_imp:: symlink ( src. as_ref ( ) , dst. as_ref ( ) )
831
831
}
832
832
833
- /// Reads a soft link, returning the file that the link points to.
833
+ /// Creates a new symbolic link on the filesystem.
834
+ ///
835
+ /// Replaced by `std::fs::symlink`.
836
+ #[ deprecated( since = "1.0.0" , reason = "replaced with std::fs::symlink" ) ]
837
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
838
+ pub fn soft_link < P : AsRef < Path > , Q : AsRef < Path > > ( src : P , dst : Q ) -> io:: Result < ( ) > {
839
+ symlink ( src, dst)
840
+ }
841
+
842
+ /// Reads a symbolic link, returning the file that the link points to.
834
843
///
835
844
/// # Errors
836
845
///
837
846
/// This function will return an error on failure. Failure conditions include
838
- /// reading a file that does not exist or reading a file that is not a soft
847
+ /// reading a file that does not exist or reading a file that is not a symbolic
839
848
/// link.
840
849
///
841
850
/// # Examples
@@ -928,8 +937,8 @@ pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
928
937
/// Removes a directory at this path, after removing all its contents. Use
929
938
/// carefully!
930
939
///
931
- /// This function does **not** follow soft links and it will simply remove the
932
- /// soft link itself.
940
+ /// This function does **not** follow symbolic links and it will simply remove the
941
+ /// symbolic link itself.
933
942
///
934
943
/// # Errors
935
944
///
@@ -1528,7 +1537,7 @@ mod tests {
1528
1537
check ! ( fs:: create_dir_all( & dtt) ) ;
1529
1538
check ! ( fs:: create_dir_all( & d2) ) ;
1530
1539
check ! ( check!( File :: create( & canary) ) . write( b"foo" ) ) ;
1531
- check ! ( fs:: soft_link ( & d2, & dt. join( "d2" ) ) ) ;
1540
+ check ! ( fs:: symlink ( & d2, & dt. join( "d2" ) ) ) ;
1532
1541
check ! ( fs:: remove_dir_all( & d1) ) ;
1533
1542
1534
1543
assert ! ( !d1. is_dir( ) ) ;
@@ -1658,7 +1667,7 @@ mod tests {
1658
1667
let out = tmpdir. join ( "out.txt" ) ;
1659
1668
1660
1669
check ! ( check!( File :: create( & input) ) . write( "foobar" . as_bytes( ) ) ) ;
1661
- check ! ( fs:: soft_link ( & input, & out) ) ;
1670
+ check ! ( fs:: symlink ( & input, & out) ) ;
1662
1671
// if cfg!(not(windows)) {
1663
1672
// assert_eq!(check!(lstat(&out)).kind, FileType::Symlink);
1664
1673
// assert_eq!(check!(out.lstat()).kind, FileType::Symlink);
@@ -1675,7 +1684,7 @@ mod tests {
1675
1684
fn symlink_noexist ( ) {
1676
1685
let tmpdir = tmpdir ( ) ;
1677
1686
// symlinks can point to things that don't exist
1678
- check ! ( fs:: soft_link ( & tmpdir. join( "foo" ) , & tmpdir. join( "bar" ) ) ) ;
1687
+ check ! ( fs:: symlink ( & tmpdir. join( "foo" ) , & tmpdir. join( "bar" ) ) ) ;
1679
1688
assert_eq ! ( check!( fs:: read_link( & tmpdir. join( "bar" ) ) ) ,
1680
1689
tmpdir. join( "foo" ) ) ;
1681
1690
}
0 commit comments