Expand description
Filesystem operations.
Structs§
- Access
*_OK
constants for use withaccessat
.- AtFlags
AT_*
constants for use withopenat
,statat
, and other*at
functions.- Clone
Flags CLONE_*
constants for use withfclonefileat
.- Copyfile
Flags COPYFILE_*
constants for use withfcopyfile
.- Dir
DIR*
- DirEntry
struct dirent
- Fallocate
Flags FALLOC_FL_*
constants for use withfallocate
.- Gid
gid_t
—A Unix group ID.- Mode
S_I*
constants for use withopenat
,chmodat
, andfchmod
.- OFlags
O_*
constants for use withopenat
.- Rename
Flags RENAME_*
constants for use withrenameat_with
.- StatVfs
struct statvfs
for use withstatvfs
andfstatvfs
.- Stat
VfsMount Flags ST_*
constants for use withStatVfs
.- Timespec
struct timespec
—A quantity of time in seconds plus nanoseconds.- Timestamps
- Timestamps used by
utimensat
andfutimens
. - Uid
uid_t
—A Unix user ID.- Xattr
Flags XATTR_*
constants for use withsetxattr
, and other*setxattr
functions.- copyfile_
state_ t copyfile_state_t
—State for use withfcopyfile
.
Enums§
- File
Type S_IF*
constants for use withmknodat
andStat
’sst_mode
field.- Flock
Operation LOCK_*
constants for use withflock
andfcntl_lock
.- Seek
From - Enumeration of possible methods to seek within an I/O object.
Constants§
- ABS
-EBADF
—A handle that requires paths to be absolute.- CWD
AT_FDCWD
—A handle representing the current working directory.- UTIME_
NOW UTIME_NOW
for use withutimensat
.- UTIME_
OMIT UTIME_OMIT
for use withutimensat
.
Traits§
- DirEntry
Ext - Re-export types common to POSIX-ish platforms.
Unix-specific extension methods for
fs::DirEntry
. - FileExt
- Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::File
. - File
Type Ext - Re-export types common to POSIX-ish platforms.
Unix-specific extensions for
fs::FileType
. - Metadata
Ext - Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::Metadata
. - Open
Options Ext - Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::OpenOptions
.
Functions§
- access
access(path, access)
—Tests permissions for a file or directory.- accessat
faccessat(dirfd, path, access, flags)
—Tests permissions for a file or directory.- chmod
chmod(path, mode)
—Sets file or directory permissions.- chmodat
fchmodat(dirfd, path, mode, flags)
—Sets file or directory permissions.- chown
chown(path, owner, group)
—Sets open file or directory ownership.- chownat
fchownat(dirfd, path, owner, group, flags)
—Sets file or directory ownership.- copyfile_
state_ alloc copyfile_state_alloc()
- copyfile_
state_ ⚠free copyfile_state_free(state)
- copyfile_
state_ ⚠get copyfile_state_get(state, flags, dst)
- copyfile_
state_ ⚠get_ copied copyfile_state_get(state, COPYFILE_STATE_COPIED)
- fallocate
fallocate(fd, mode, offset, len)
—Adjusts file allocation.- fchmod
fchmod(fd, mode)
—Sets open file or directory permissions.- fchown
fchown(fd, owner, group)
—Sets open file or directory ownership.- fclonefileat
fclonefileat(src, dst_dir, dst, flags)
—Efficiently copies between files.- fcntl_
fullfsync fcntl(fd, F_FULLFSYNC)
- fcntl_
getfl fcntl(fd, F_GETFL)
—Returns a file descriptor’s access mode and status.- fcntl_
global_ nocache fcntl(fd, F_GLOBAL_NOCACHE, value)
—Turn data caching off or on for all file descriptors.- fcntl_
lock fcntl(fd, F_SETLK)
—Acquire or release anfcntl
-style lock.- fcntl_
nocache fcntl(fd, F_NOCACHE, value)
—Turn data caching off or on for a file descriptor.- fcntl_
rdadvise fcntl(fd, F_RDADVISE, radvisory { offset, len })
- fcntl_
setfl fcntl(fd, F_SETFL, flags)
—Sets a file descriptor’s status.- fcopyfile⚠
fcopyfile(from, to, state, flags)
- fgetxattr
fgetxattr(fd, name, value.as_ptr(), value.len())
—Get extended filesystem attributes on an open file descriptor.- flistxattr
flistxattr(fd, list.as_ptr(), list.len())
—List extended filesystem attributes on an open file descriptor.- flock
flock(fd, operation)
—Acquire or release an advisory lock on an open file.- fremovexattr
fremovexattr(fd, name)
—Remove an extended filesystem attribute on an open file descriptor.- fsetxattr
fsetxattr(fd, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes on an open file descriptor.- fstat
fstat(fd)
—Queries metadata for an open file or directory.- fstatfs
fstatfs(fd)
—Queries filesystem statistics for an open file or directory.- fstatvfs
fstatvfs(fd)
—Queries filesystem statistics for an open file or directory, POSIX version.- fsync
fsync(fd)
—Ensures that file data and metadata is written to the underlying storage device.- ftruncate
ftruncate(fd, length)
—Sets the length of a file.- futimens
futimens(fd, times)
—Sets timestamps for an open file or directory.- getpath
fcntl(fd, F_GETPATH)
- getxattr
getxattr(path, name, value)
—Get extended filesystem attributes.- lgetxattr
lgetxattr(path, name, value.as_ptr(), value.len())
—Get extended filesystem attributes, without following symlinks in the last path component.- link
link(old_path, new_path)
—Creates a hard link.- linkat
linkat(old_dirfd, old_path, new_dirfd, new_path, flags)
—Creates a hard link.- listxattr
listxattr(path, list.as_ptr(), list.len())
—List extended filesystem attributes.- llistxattr
llistxattr(path, list.as_ptr(), list.len())
—List extended filesystem attributes, without following symlinks in the last path component.- lremovexattr
lremovexattr(path, name)
—Remove an extended filesystem attribute, without following symlinks in the last path component.- lsetxattr
setxattr(path, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes, without following symlinks in the last path component.- lstat
lstat(path)
—Queries metadata for a file or directory, without following symlinks.- major
major(dev)
—Compute the major ID of a given device ID.- makedev
makedev(maj, min)
—Compute a device ID from a given major and minor ID.- minor
minor(dev)
—Compute the minor ID of a given device ID.- mkdir
mkdir(path, mode)
—Creates a directory.- mkdirat
mkdirat(fd, path, mode)
—Creates a directory.- open
open(path, oflags, mode)
—Opens a file.- openat
openat(dirfd, path, oflags, mode)
—Opens a file.- readlink
readlink(path)
—Reads the contents of a symlink.- readlinkat
readlinkat(fd, path)
—Reads the contents of a symlink.- readlinkat_
raw readlinkat(fd, path)
—Reads the contents of a symlink, without allocating.- removexattr
removexattr(path, name)
—Remove an extended filesystem attribute.- rename
rename(old_path, new_path)
—Renames a file or directory.- renameat
renameat(old_dirfd, old_path, new_dirfd, new_path)
—Renames a file or directory.- renameat_
with renameat2(old_dirfd, old_path, new_dirfd, new_path, flags)
—Renames a file or directory.- rmdir
rmdir(path)
—Removes a directory.- seek
lseek(fd, offset, whence)
—Repositions a file descriptor within a file.- setxattr
setxattr(path, name, value.as_ptr(), value.len(), flags)
—Set extended filesystem attributes.- stat
stat(path)
—Queries metadata for a file or directory.- statat
fstatat(dirfd, path, flags)
—Queries metadata for a file or directory.- statfs
statfs
—Queries filesystem metadata.- statvfs
statvfs
—Queries filesystem metadata, POSIX version.- symlink
symlink(old_path, new_path)
—Creates a symlink.- symlinkat
symlinkat(old_path, new_dirfd, new_path)
—Creates a symlink.- sync
sync
—Flush cached filesystem data for all filesystems.- tell
lseek(fd, 0, SEEK_CUR)
—Returns the current position within a file.- unlink
unlink(path)
—Unlinks a file.- unlinkat
unlinkat(fd, path, flags)
—Unlinks a file or remove a directory.- utimensat
utimensat(dirfd, path, times, flags)
—Sets file or directory timestamps.