doc.rust-lang.org
pub fn symlink_metadata<P>(path: P) -> io::Result<Metadata>
Queries the metadata about a file without following symlinks.
function
std
Stable since 1.1.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn soft_link<P, Q>(original: P, link: Q) -> io::Result<()>
Creates a new symbolic link on the filesystem.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_times_nofollow<P>(path: P, times: FileTimes) -> io::Result<()>
Changes the timestamps of the file or symlink at the specified path.
function
std
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_times<P>(path: P, times: FileTimes) -> io::Result<()>
Changes the timestamps of the file or directory at the specified path.
function
std
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn set_permissions<P>(path: P, perm: Permissions) -> io::Result<()>
Changes the permissions found on a file or a directory.
function
std
Stable since 1.1.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn rename<P, Q>(from: P, to: Q) -> io::Result<()>
Renames a file or directory to a new name, replacing the original file if to already exists.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn remove_file<P>(path: P) -> io::Result<()>
Removes a file from the filesystem.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn remove_dir_all<P>(path: P) -> io::Result<()>
Removes a directory at this path, after removing all its contents. Use carefully!
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn remove_dir<P>(path: P) -> io::Result<()>
Removes an empty directory.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_to_string<P>(path: P) -> io::Result<String>
Reads the entire contents of a file into a string.
function
std
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_link<P>(path: P) -> io::Result<crate::path::PathBuf>
Reads a symbolic link, returning the file that the link points to.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_dir<P>(path: P) -> io::Result<ReadDir>
Returns an iterator over the entries within a directory.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read<P>(path: P) -> io::Result<Vec<u8>>
Reads the entire contents of a file into a bytes vector.
function
std
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn metadata<P>(path: P) -> io::Result<Metadata>
Given a path, queries the file system to get information about a file, directory, etc.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn hard_link<P, Q>(original: P, link: Q) -> io::Result<()>
Creates a new hard link on the filesystem.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn exists<P>(path: P) -> io::Result<bool>
Returns Ok(true) if the path points at an existing entity.
function
std
Stable since 1.81.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn create_dir_all<P>(path: P) -> io::Result<()>
Recursively create a directory and all of its parent components if they are missing.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn create_dir<P>(path: P) -> io::Result<()>
Creates a new, empty directory at the provided path.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn copy<P, Q>(from: P, to: Q) -> io::Result<u64>
Copies the contents of one file to another. This function will also copy the permission bits of the original file to the destination file.
function
std
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn canonicalize<P>(path: P) -> io::Result<crate::path::PathBuf>
Returns the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved.
function
std
Stable since 1.5.0
Version 1.100.0-nightly