Expand description
Filesystem utilities.
Structs§
- Access
Modes - Access modes for use with [
DirExt::access]. - DirBuilder
- A builder used to create directories in various manners.
- DirEntry
- Entries returned by the
ReadDiriterator. - DirOptions
- Options and flags which can be used to configure how a directory is created.
- File
Type - A structure representing a type of file with accessors for each file type.
- Metadata
- Metadata information about a file.
- Open
Options - Options and flags which can be used to configure how a file is opened.
- Permissions
- Representation of the various permissions on a file.
- ReadDir
- Iterator over the entries in a directory.
Enums§
- Access
Type - Access modes for use with [
DirExt::access]. - Follow
Symlinks - Should symlinks be followed in the last component of a path?
- System
Time Spec - A value for specifying a time.
Traits§
- DirBuilder
Ext - Unix-specific extensions to [
fs::DirBuilder]. - FileExt
- Unix-specific extensions to [
fs::File]. - File
Type Ext - Unix-specific extensions for
FileType. - Metadata
Ext - Unix-specific extensions for
MetadataExt. - Open
Options Ext - Unix-specific extensions to [
fs::OpenOptions]. - Permissions
Ext - Unix-specific extensions to
Permissions.
Functions§
- access
- Canonicalize the given path, ensuring that the resolution of the path never
escapes the directory tree rooted at
start. - canonicalize
- Canonicalize the given path, ensuring that the resolution of the path never
escapes the directory tree rooted at
start. - copy
- Copies the contents of one file to another.
- create_
dir - Perform a
mkdirat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - hard_
link - Perform a
linkat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - is_
file_ read_ write - Return a pair of booleans indicating whether the given file is opened for reading and writing, respectively.
- open
- Perform an
openat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - open_
ambient - Open a file named by a bare path, using the host process’ ambient authority.
- open_
ambient_ dir - Open a directory named by a bare path, using the host process’ ambient authority.
- open_
dir - Open a directory by performing an
openat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - open_
dir_ nofollow - Similar to
open_dir, but fails if the path names a symlink. - open_
parent_ dir - Open the parent directory of a given open directory, using the host process’ ambient authority.
- read_
base_ dir - Like
read_dirbut operates on the base directory itself, rather than on a path based on it. - read_
dir - Construct a
ReadDirto iterate over the contents of a directory, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - read_
link - Perform a
readlinkat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart, and also verifies that the link target is not absolute. - read_
link_ contents - Perform a
readlinkat-like operation, ensuring that the resolution of the link path never escapes the directory tree rooted atstart. - remove_
dir - Perform a
rmdirat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - remove_
dir_ all - Removes a directory and all of its contents.
- remove_
file - Perform a
remove_fileat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - remove_
open_ dir - Given an open directory handle, delete the directory.
- remove_
open_ dir_ all - Given an open directory handle, recursively delete the contents of the directory plus the directory itself.
- rename
- Perform a
renameat-like operation, ensuring that the resolution of both the old and new paths never escape the directory tree rooted at their respective starts. - reopen
- Re-open an
fs::Fileto produce an independent handle. - set_
permissions - Perform a
chmodat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - set_
symlink_ permissions - Perform a
chmodat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart, without following symlinks. - set_
times - Perform a
utimensat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. This function follows symlinks. - set_
times_ nofollow - Like
set_times, but never follows symlinks. - stat
- Perform an
fstatat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. - symlink
- Perform a
symlinkat-like operation, ensuring that the resolution of the path never escapes the directory tree rooted atstart. An error is returned if the target path is absolute. - symlink_
contents - Perform a
symlinkat-like operation, ensuring that the resolution of the link path never escapes the directory tree rooted atstart.