Expand description
Filesystem operations.
Re-exports
pub use crate::io::FdFlags;
pub use crate::io::fcntl_dupfd_cloexec;
pub use crate::io::fcntl_getfd;
pub use crate::io::fcntl_setfd;
Structs
*_OK
constants for use withaccessat
.CLONE_*
constants for use withfclonefileat
.COPYFILE_*
constants for use withfcopyfile
.DIR*
struct dirent
FALLOC_FL_*
constants for use withfallocate
.gid_t
—A Unix group ID.O_*
constants for use withopenat
.ST_*
constants for use withStatVfs
.uid_t
—A Unix user ID.copyfile_state_t
—State for use withfcopyfile
.
Enums
- 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
- Re-export types common to POSIX-ish platforms. Unix-specific extension methods for
fs::DirEntry
. - Re-export types common to POSIX-ish platforms. Unix-specific extensions to
fs::File
. - Re-export types common to POSIX-ish platforms. Unix-specific extensions for
fs::FileType
. - Re-export types common to POSIX-ish platforms. Unix-specific extensions to
fs::Metadata
. - Re-export types common to POSIX-ish platforms. Unix-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.chmod(path, mode)
—Sets file or directory permissions.fchmodat(dirfd, path, mode, flags)
—Sets file or directory permissions.chown(path, owner, group)
—Sets open file or directory ownership.fchownat(dirfd, path, owner, group, flags)
—Sets file or directory ownership.copyfile_state_alloc()
copyfile_state_free(state)
copyfile_state_get(state, flags, dst)
copyfile_state_get(state, COPYFILE_STATE_COPIED)
- cwdDeprecatedReturn the value of
CWD
. fallocate(fd, mode, offset, len)
—Adjusts file allocation.fchmod(fd, mode)
—Sets open file or directory permissions.fchown(fd, owner, group)
—Sets open file or directory ownership.fclonefileat(src, dst_dir, dst, flags)
—Efficiently copies between files.fcntl(fd, F_FULLFSYNC)
fcntl(fd, F_GETFL)
—Returns a file descriptor’s access mode and status.fcntl(fd, F_GLOBAL_NOCACHE, value)
—Turn data caching off or on for all file descriptors.fcntl(fd, F_SETLK)
—Acquire or release anfcntl
-style lock.fcntl(fd, F_NOCACHE, value)
—Turn data caching off or on for a file descriptor.fcntl(fd, F_RDADVISE, radvisory { offset, len })
fcntl(fd, F_SETFL, flags)
—Sets a file descriptor’s status.fcopyfile(from, to, state, flags)
fgetxattr(fd, name, value.as_ptr(), value.len())
—Get extended filesystem attributes on an open file descriptor.flistxattr(fd, list.as_ptr(), list.len())
—List extended filesystem attributes on an open file descriptor.flock(fd, operation)
—Acquire or release an advisory lock on an open file.fremovexattr(fd, name)
—Remove an extended filesystem attribute on an open file descriptor.fsetxattr(fd, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes on an open file descriptor.fstat(fd)
—Queries metadata for an open file or directory.fstatfs(fd)
—Queries filesystem statistics for an open file or directory.fstatvfs(fd)
—Queries filesystem statistics for an open file or directory, POSIX version.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_GETPATH)
getxattr(path, name, value.as_ptr(), value.len())
—Get extended filesystem attributes.fcntl(fd, F_GETFL) & O_ACCMODE
lgetxattr(path, name, value.as_ptr(), value.len())
—Get extended filesystem attributes, without following symlinks in the last path component.link(old_path, new_path)
—Creates a hard link.linkat(old_dirfd, old_path, new_dirfd, new_path, flags)
—Creates a hard link.listxattr(path, list.as_ptr(), list.len())
—List extended filesystem attributes.llistxattr(path, list.as_ptr(), list.len())
—List extended filesystem attributes, without following symlinks in the last path component.lremovexattr(path, name)
—Remove an extended filesystem attribute, without following symlinks in the last path component.setxattr(path, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes, without following symlinks in the last path component.lstat(path)
—Queries metadata for a file or directory, without following symlinks.major(dev)
makedev(maj, min)
minor(dev)
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.removexattr(path, name)
—Remove an extended filesystem attribute.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.setxattr(path, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes.stat(path)
—Queries metadata for a file or directory.fstatat(dirfd, path, flags)
—Queries metadata for a file or directory.statfs
—Queries filesystem metadata.statvfs
—Queries filesystem metadata, POSIX version.symlink(old_path, new_path)
—Creates a symlink.symlinkat(old_path, new_dirfd, new_path)
—Creates a symlink.sync
—Flush cached filesystem data for all filesystems.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.