pub fn change_dir(p: &Path) -> bool {
    return chdir(p);

    #[cfg(windows)]
    fn chdir(p: &Path) -> bool {
        unsafe {
            use os::win32::as_utf16_p;
            return as_utf16_p(p.as_str().unwrap(), |buf| {
                libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
            });
        }
    }

    #[cfg(unix)]
    fn chdir(p: &Path) -> bool {
        p.with_c_str(|buf| {
            unsafe {
                libc::chdir(buf) == (0 as c_int)
            }
        })
    }
}
/// Changes the current working directory to the specified path, returning
/// whether the change was completed successfully or not.
Changes the current working directory to the specified path, returning
whether the change was completed successfully or not.
Changes the current working directory to the specified path returning whether the change was completed successfully or not .
pub fn change_dir(p: &Path) -> bool {
    return chdir(p);
    #[cfg(windows)]
    fn chdir(p: &Path) -> bool {
        unsafe {
            use os::win32::as_utf16_p;
            return as_utf16_p(p.as_str().unwrap(), |buf| {
                libc::SetCurrentDirectoryW(buf) != (0 as libc::BOOL)
            });
        }
    }
    #[cfg(unix)]
    fn chdir(p: &Path) -> bool {
        p.with_c_str(|buf| {
            unsafe {
                libc::chdir(buf) == (0 as c_int)
            }
        })
    }
}
pub fn change_dir ( p : & Path ) -> bool { return chdir ( p ) ; # [ cfg ( windows ) ] fn chdir ( p : & Path ) -> bool { unsafe { use os :: win32 :: as_utf16_p ; return as_utf16_p ( p . as_str ( ) . unwrap ( ) , | buf | { libc :: SetCurrentDirectoryW ( buf ) != ( 0 as libc :: BOOL ) } ) ; } } # [ cfg ( unix ) ] fn chdir ( p : & Path ) -> bool { p . with_c_str ( | buf | { unsafe { libc :: chdir ( buf ) == ( 0 as c_int ) } } ) } }
Changes the current working directory to the specified path, returning
whether the change was completed successfully or not.
Changes the current working directory to the specified path returning whether the change was completed successfully or not .
p
&Path
p
&Path