Available on crate feature
fs only.Expand description
Filesystem operations.
Modules§
- inotify
linux_raw_dep - inotify support for working with inotify objects.
Structs§
- Access
*_OKconstants for use withaccessat.- AtFlags
AT_*constants for use withopenat,statat, and other*atfunctions.- Dir
allocand neithertarget_os=espidfnor Redox DIR*- DirEntry
allocand neithertarget_os=espidfnor Redox struct dirent- Fallocate
Flags FALLOC_FL_*constants for use withfallocate.- Fsid
fsid_tfor use withStatFs.- Gid
gid_t—A Unix group ID.- IFlags
linux_kernel FS_*constants for use withioctl_getflags.- Memfd
Flags MFD_*constants for use withmemfd_create.- Mode
S_I*constants for use withopenat,chmodat, andfchmod.- OFlags
O_*constants for use withopenat.- RawDir
linux_kernel - A directory iterator implemented with getdents.
- RawDir
Entry linux_kernel - A raw directory entry, similar to
std::fs::DirEntry. - Rename
Flags RENAME_*constants for use withrenameat_with.- Resolve
Flags RESOLVE_*constants for use withopenat2.- Seal
Flags F_SEAL_*constants for use withfcntl_add_sealsandfcntl_get_seals.- Stat
x86-64 struct statfor use withstatatandfstat.- StatFs
struct statfsfor use withstatfsandfstatfs.- StatVfs
struct statvfsfor use withstatvfsandfstatvfs.- Stat
VfsMount Flags ST_*constants for use withStatVfs.- Statx
linux_kernel struct statxfor use withstatx.- Statx
Attributes linux_kernel STATX_ATTR_*flags for use withStatx.- Statx
Flags linux_kernel STATX_*constants for use withstatx.- Statx
Timestamp linux_kernel struct statx_timestampfor use withStatx.- Timespec
struct timespec—A quantity of time in seconds plus nanoseconds.- Timestamps
- Timestamps used by
utimensatandfutimens. - Uid
uid_t—A Unix user ID.- Xattr
Flags appleorlinux_kernelortarget_os=hurd XATTR_*constants for use withsetxattr, and other*setxattrfunctions.
Enums§
- Advice
POSIX_FADV_*constants for use withfadvise.- File
Type S_IF*constants for use withmknodatandStat’sst_modefield.- Flock
Operation LOCK_*constants for use withflockandfcntl_lock.- Seek
From - Enumeration of possible methods to seek within an I/O object.
Constants§
- ABS
Non- target_os=espidf -EBADF—A handle that requires paths to be absolute.- CWD
Non- target_os=espidfand non-target_os=horizon AT_FDCWD—A handle representing the current working directory.- NFS_
SUPER_ MAGIC linux_kernel - The filesystem magic number for NFS.
- PROC_
SUPER_ MAGIC linux_kernel - The filesystem magic number for procfs.
- UTIME_
NOW Neither target_os=espidfnortarget_os=horizonnor Redox nortarget_os=vita UTIME_NOWfor use withutimensat.- UTIME_
OMIT Neither target_os=espidfnortarget_os=horizonnor Redox nortarget_os=vita UTIME_OMITfor use withutimensat.
Traits§
- DirEntry
Ext stdand Unix - Re-export types common to POSIX-ish platforms.
Unix-specific extension methods for
fs::DirEntry. - FileExt
stdand Unix - Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::File. - File
Type Ext stdand Unix - Re-export types common to POSIX-ish platforms.
Unix-specific extensions for
fs::FileType. - Metadata
Ext stdand Unix - Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::Metadata. - Open
Options Ext stdand Unix - Re-export types common to POSIX-ish platforms.
Unix-specific extensions to
fs::OpenOptions.
Functions§
- access
Neither target_os=espidfnortarget_os=horizonnortarget_os=vita access(path, access)—Tests permissions for a file or directory.- accessat
Neither target_os=espidfnortarget_os=horizonnortarget_os=vitanor Redox faccessat(dirfd, path, access, flags)—Tests permissions for a file or directory.- chmod
Non-WASI chmod(path, mode)—Sets file or directory permissions.- chmodat
Neither target_os=espidfnor WASI nor Redox fchmodat(dirfd, path, mode, flags)—Sets file or directory permissions.- chown
Non-WASI chown(path, owner, group)—Sets open file or directory ownership.- chownat
Neither target_os=espidfnor WASI nor Redox fchownat(dirfd, path, owner, group, flags)—Sets file or directory ownership.- copy_
file_ range linux_kernel copy_file_range(fd_in, off_in, fd_out, off_out, len, 0)—Copies data from one file to another.- ext4_
ioc_ resize_ fs linux_kernelandlinux_raw_dep ioctl(fd, EXT4_IOC_RESIZE_FS, blocks)—Resize ext4 filesystem on fd.- fadvise
Neither applenornetbsdlikenor DragonFly BSD nortarget_os=espidfnor Haiku nortarget_os=horizonnor Redox nor Solaris nortarget_os=vita posix_fadvise(fd, offset, len, advice)—Declares an expected access pattern for a file.- fallocate
Neither netbsdlikenor DragonFly BSD nortarget_os=espidfnortarget_os=horizonnortarget_os=ntonor Redox nortarget_os=vita fallocate(fd, mode, offset, len)—Adjusts file allocation.- fchmod
Non-WASI fchmod(fd, mode)—Sets open file or directory permissions.- fchown
Non-WASI fchown(fd, owner, group)—Sets open file or directory ownership.- fcntl_
add_ seals linux_kernelor FreeBSD or Fuchsia fcntl(fd, F_ADD_SEALS)—Add seals tofd’s inode.- fcntl_
get_ seals linux_kernelor FreeBSD or Fuchsia fcntl(fd, F_GET_SEALS)—Return the seals forfd’s inode.- fcntl_
getfl fcntl(fd, F_GETFL)—Returns a file descriptor’s access mode and status.- fcntl_
lock Neither Emscripten nor target_os=espidfnor Fuchsia nortarget_os=horizonnor Redox nortarget_os=vitanor WASI fcntl(fd, F_SETLK)—Acquire or release anfcntl-style lock.- fcntl_
setfl fcntl(fd, F_SETFL, flags)—Sets a file descriptor’s status.- fdatasync
Neither applenor DragonFly BSD nortarget_os=espidfnor Haiku nortarget_os=horizonnor Redox nortarget_os=vita fdatasync(fd)—Ensures that file data is written to the underlying storage device.- fgetxattr
appleorlinux_kernelortarget_os=hurd fgetxattr(fd, name, value.as_ptr(), value.len())—Get extended filesystem attributes on an open file descriptor.- flistxattr
appleorlinux_kernelortarget_os=hurd flistxattr(fd, list.as_ptr(), list.len())—List extended filesystem attributes on an open file descriptor.- flock
Neither target_os=espidfnortarget_os=horizonnor Solaris nortarget_os=vitanor WASI flock(fd, operation)—Acquire or release an advisory lock on an open file.- fremovexattr
appleorlinux_kernelortarget_os=hurd fremovexattr(fd, name)—Remove an extended filesystem attribute on an open file descriptor.- fsetxattr
appleorlinux_kernelortarget_os=hurd 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
Neither solarishnortarget_os=espidfnor Haiku nortarget_os=horizonnor NetBSD nortarget_os=ntonor Redox nortarget_os=vitanor WASI fstatfs(fd)—Queries filesystem statistics for an open file or directory.- fstatvfs
Non-WASI 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
Neither target_os=espidfnortarget_os=horizonnortarget_os=vita futimens(fd, times)—Sets timestamps for an open file or directory.- getxattr
appleorlinux_kernelortarget_os=hurd getxattr(path, name, value)—Get extended filesystem attributes.- ioctl_
blkpbszget linux_kernel ioctl(fd, BLKPBSZGET)—Returns the physical block size of a block device.- ioctl_
blksszget linux_kernel ioctl(fd, BLKSSZGET)—Returns the logical block size of a block device.- ioctl_
ficlone linux_kerneland neithertarget_arch=sparcnor SPARC64 ioctl(fd, FICLONE, src_fd)—Share data between open files.- ioctl_
getflags linux_kernelandlinux_raw_dep ioctl(fd, FS_IOC_GETFLAGS)—Returns the inode flags attributes- ioctl_
setflags linux_kernelandlinux_raw_dep ioctl(fd, FS_IOC_SETFLAGS)—Modify the inode flags attributes- lgetxattr
appleorlinux_kernelortarget_os=hurd 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
Neither target_os=espidfnor Redox linkat(old_dirfd, old_path, new_dirfd, new_path, flags)—Creates a hard link.- listxattr
appleorlinux_kernelortarget_os=hurd listxattr(path, list.as_ptr(), list.len())—List extended filesystem attributes.- llistxattr
appleorlinux_kernelortarget_os=hurd llistxattr(path, list.as_ptr(), list.len())—List extended filesystem attributes, without following symlinks in the last path component.- lremovexattr
appleorlinux_kernelortarget_os=hurd lremovexattr(path, name)—Remove an extended filesystem attribute, without following symlinks in the last path component.- lsetxattr
appleorlinux_kernelortarget_os=hurd 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
Neither target_os=espidfnor Haiku nortarget_os=horizonnortarget_os=vitanor WASI major(dev)—Compute the major ID of a given device ID.- makedev
Neither target_os=espidfnor Haiku nortarget_os=horizonnortarget_os=vitanor WASI makedev(maj, min)—Compute a device ID from a given major and minor ID.- memfd_
create linux_kernelor FreeBSD memfd_create(name, flags)—Create an anonymous file.- minor
Neither target_os=espidfnor Haiku nortarget_os=horizonnortarget_os=vitanor WASI minor(dev)—Compute the minor ID of a given device ID.- mkdir
mkdir(path, mode)—Creates a directory.- mkdirat
Non-Redox mkdirat(fd, path, mode)—Creates a directory.- mkfifoat
Neither applenortarget_os=espidfnortarget_os=horizonnortarget_os=vitanor WASI nor Redox mkfifoat(dirfd, path, mode)—Make a FIFO special file.- mknodat
Neither applenortarget_os=espidfnortarget_os=horizonnortarget_os=vitanor WASI nor Redox mknodat(dirfd, path, mode, dev)—Creates special or normal files.- open
open(path, oflags, mode)—Opens a file.- openat
Non-Redox openat(dirfd, path, oflags, mode)—Opens a file.- openat2
linux_raw_dep openat2(dirfd, path, OpenHow { oflags, mode, resolve }, sizeof(OpenHow))— Opens a file with more options.- readlink
alloc readlink(path)—Reads the contents of a symlink.- readlinkat
alloc readlinkat(fd, path)—Reads the contents of a symlink.- readlinkat_
raw Non-Redox readlinkat(fd, path)—Reads the contents of a symlink, without allocating.- removexattr
appleorlinux_kernelortarget_os=hurd 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 appleorlinux_kernelor Redox 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.- sendfile
Linux sendfile(out_fd, in_fd, offset, count)—Transfer data between file descriptors.- setxattr
appleorlinux_kernelortarget_os=hurd setxattr(path, name, value.as_ptr(), value.len(), flags)—Set extended filesystem attributes.- stat
stat(path)—Queries metadata for a file or directory.- statat
Neither target_os=espidfnor Redox fstatat(dirfd, path, flags)—Queries metadata for a file or directory.- statfs
Neither solarishnortarget_os=espidfnor Haiku nortarget_os=horizonnor NetBSD nortarget_os=ntonor Redox nortarget_os=vitanor WASI statfs—Queries filesystem metadata.- statvfs
Neither WASI statvfs—Queries filesystem metadata, POSIX version.- statx
linux_kernel statx(dirfd, path, flags, mask, statxbuf)—Extendedstat.- symlink
symlink(old_path, new_path)—Creates a symlink.- symlinkat
Non-Redox symlinkat(old_path, new_dirfd, new_path)—Creates a symlink.- sync
Neither target_os=espidfnortarget_os=horizonnor Redox nortarget_os=vitanor WASI sync—Flush cached filesystem data for all filesystems.- syncfs
linux_kernel syncfs(fd)—Flush cached filesystem data.- tell
lseek(fd, 0, SEEK_CUR)—Returns the current position within a file.- unlink
unlink(path)—Unlinks a file.- unlinkat
Neither target_os=espidfnor Redox unlinkat(fd, path, flags)—Unlinks a file or remove a directory.- utimensat
Neither target_os=espidfnortarget_os=horizonnortarget_os=vitanor Redox utimensat(dirfd, path, times, flags)—Sets file or directory timestamps.