[go: up one dir, main page]

Module fs

Module fs 

Source
Expand description

Set of functions to manage regular files, special files, and links.

Modules§

sane_blksize

Macros§

has
Used to check if the mode has its perm bit set.

Structs§

FileInformation
Information to uniquely identify a file

Enums§

MissingHandling
Controls how symbolic links should be handled when canonicalizing a path.
ResolveMode
Controls when symbolic links are resolved

Functions§

are_hardlinks_or_one_way_symlink_to_same_file
Checks if either two paths are hard links to the same file or if the source path is a symbolic link which when fully resolved points to target path
are_hardlinks_to_same_file
Checks if two paths are hard links to the same file.
canonicalize
Return the canonical, absolute form of a path.
dir_strip_dot_for_creation
For some programs like install or mkdir, dir/. or dir/./ can be provided Special case to match GNU’s behavior: install -d foo/. (and foo/./) should work and just create foo/ std::fs::create_dir(“foo/.”); fails in pure Rust
display_permissions
Display the permissions of a file
display_permissions_unix
Display the permissions of a file on a unix like system
get_filename
Extracts the filename component from the given file path and returns it as an Option<&str>.
infos_refer_to_same_file
Checks if p1 and p2 are the same file information. If error happens when trying to get files’ metadata, returns false
is_stdin_directory
Checks if the standard input (stdin) is a directory.
is_symlink_loop
Checks if there is a symlink loop in the given path.
make_fifo
Make a FIFO, also known as a named pipe.
make_path_relative_to
Converts absolute path to be relative to absolute to path.
normalize_path
Normalize a path by removing relative information For example, convert ‘bar/../foo/bar.txt’ => ‘foo/bar.txt’ copied from <https://github.com/rust-lang/cargo/blob/2e4cfc2b7d43328b207879228a2ca7d427d188bb/src/cargo/util/paths.rs#L65-L90> both projects are MIT <https://github.com/rust-lang/cargo/blob/master/LICENSE-MIT> for std impl progress see rfc <https://github.com/rust-lang/rfcs/issues/2208> replace this once that lands
path_ends_with_terminator
Returns true if the passed path ends with a path terminator.
paths_refer_to_same_file
Checks if p1 and p2 are the same file. If error happens when trying to get files’ metadata, returns false