Available on crate feature
fs
only.Expand description
Filesystem operations.
Re-exports§
pub use crate::io::FdFlags;
pub use crate::io::fcntl_getfd;
pub use crate::io::fcntl_setfd;
Structs§
*_OK
constants for use withaccessat
.DIR*
struct dirent
FALLOC_FL_*
constants for use withfallocate
.O_*
constants for use withopenat
.
Enums§
POSIX_FADV_*
constants for use withfadvise
.- Enumeration of possible methods to seek within an I/O object.
Constants§
AT_FDCWD
—A handle representing the current working directory.UTIME_NOW
for use withutimensat
.UTIME_OMIT
for use withutimensat
.
Traits§
- DirEntryExtExperimentalWASI-specific extension methods for
fs::DirEntry
. - FileExtExperimentalWASI-specific extensions to
File
. - FileTypeExtExperimentalWASI-specific extensions for
fs::FileType
. - MetadataExtExperimentalWASI-specific extensions to
fs::Metadata
. - OpenOptionsExtExperimentalWASI-specific extensions to
fs::OpenOptions
.
Functions§
access(path, access)
—Tests permissions for a file or directory.faccessat(dirfd, path, access, flags)
—Tests permissions for a file or directory.- cwdDeprecatedReturn the value of
CWD
. posix_fadvise(fd, offset, len, advice)
—Declares an expected access pattern for a file.fallocate(fd, mode, offset, len)
—Adjusts file allocation.fcntl(fd, F_GETFL)
—Returns a file descriptor’s access mode and status.fcntl(fd, F_SETFL, flags)
—Sets a file descriptor’s status.fdatasync(fd)
—Ensures that file data is written to the underlying storage device.fstat(fd)
—Queries metadata for an open file or directory.fsync(fd)
—Ensures that file data and metadata is written to the underlying storage device.ftruncate(fd, length)
—Sets the length of a file.futimens(fd, times)
—Sets timestamps for an open file or directory.fcntl(fd, F_GETFL) & O_ACCMODE
link(old_path, new_path)
—Creates a hard link.linkat(old_dirfd, old_path, new_dirfd, new_path, flags)
—Creates a hard link.lstat(path)
—Queries metadata for a file or directory, without following symlinks.mkdir(path, mode)
—Creates a directory.mkdirat(fd, path, mode)
—Creates a directory.open(path, oflags, mode)
—Opens a file.openat(dirfd, path, oflags, mode)
—Opens a file.readlink(path)
—Reads the contents of a symlink.readlinkat(fd, path)
—Reads the contents of a symlink.readlinkat(fd, path)
—Reads the contents of a symlink, without allocating.rename(old_path, new_path)
—Renames a file or directory.renameat(old_dirfd, old_path, new_dirfd, new_path)
—Renames a file or directory.rmdir(path)
—Removes a directory.lseek(fd, offset, whence)
—Repositions a file descriptor within a file.stat(path)
—Queries metadata for a file or directory.fstatat(dirfd, path, flags)
—Queries metadata for a file or directory.symlink(old_path, new_path)
—Creates a symlink.symlinkat(old_path, new_dirfd, new_path)
—Creates a symlink.lseek(fd, 0, SEEK_CUR)
—Returns the current position within a file.unlink(path)
—Unlinks a file.unlinkat(fd, path, flags)
—Unlinks a file or remove a directory.utimensat(dirfd, path, times, flags)
—Sets file or directory timestamps.