Module posish::fs[][src]

Expand description

Filesystem operations.

Structs

Access

*_OK constants for use with accessat.

AtFlags

AT_* constants.

CloneFlags

CLONE_* constants.

CopyfileFlags

COPYFILE_* constants.

Dir

DIR*

Entry

struct dirent

FdFlags

FD_* constants.

Mode

S_I* constants.

OFlags

O_* constants.

SeekLoc

A location for use with Dir::seek.

copyfile_state_t

copyfile_state_t

Enums

FileType

S_IF* constants.

Constants

UTIME_NOW

Re-export UTIME_NOW and UTIME_OMIT.

UTIME_OMIT

Re-export UTIME_NOW and UTIME_OMIT.

Traits

DirEntryExt

Re-export types common to Posix-ish platforms.

FileExt

Re-export types common to Posix-ish platforms.

FileTypeExt

Re-export types common to Posix-ish platforms.

MetadataExt

Re-export types common to Posix-ish platforms.

OpenOptionsExt

Re-export types common to Posix-ish platforms.

Functions

accessat

faccessat(dirfd, path, access, flags)

chmodat

fchmodat(dirfd, path, mode, 0)

copyfile_state_alloc

copyfile_state_alloc()

copyfile_state_free

copyfile_state_free(state)

copyfile_state_get_copied

copyfile_state_get(state, COPYFILE_STATE_COPIED)

cwd

Return a “file” which holds a handle which refers to the process current directory (AT_FDCWD).

fchmod

fchmod(fd).

fclonefileat

fclonefileat(src, dst_dir, dst, flags)

fcntl_dupfd_cloexec

fcntl(fd, F_DUPFD_CLOEXEC)

fcntl_getfd

fcntl(fd, F_GETFD)

fcntl_getfl

fcntl(fd, F_GETFL)

fcntl_setfd

fcntl(fd, F_SETFD, flags)

fcntl_setfl

fcntl(fd, F_SETFL, flags)

fcopyfile

fcopyfile(from, to, state, flags)

fstat

fstat(fd)

fstatfs

fstatfs(fd)

fsync

fsync(fd)

ftruncate

ftruncate(fd, length)

futimens

futimens(fd, times)

getpath

fcntl(fd, F_GETPATH)

is_file_read_write

fcntl(fd, F_GETFL) & O_ACCMODE. Returns a pair of booleans indicating whether the file descriptor is readable and/or writeable, respectively. This is only reliable on files; for example, it doesn’t reflect whether sockets have been shut down; for general I/O handle support, use io::is_read_write.

linkat

linkat(old_dirfd, old_path, new_dirfd, new_path, flags)

mkdirat

mkdirat(fd, path, mode)

openat

openat(dirfd, path, oflags, mode)

posix_fallocate

posix_fallocate(fd, offset, len)

readlinkat

readlinkat(fd, path)

renameat

renameat(old_dirfd, old_path, new_dirfd, new_path)

seek

lseek(fd, offset, whence)

statat

fstatat(dirfd, path, flags)

symlinkat

symlinkat(old_dirfd, old_path, new_dirfd, new_path)

tell

lseek(fd, 0, SEEK_CUR)

unlinkat

unlinkat(fd, path, flags)

utimensat

utimensat(dirfd, path, times, flags)

Type Definitions

RawMode

Re-export mode_t.

Stat

Re-export stat (or stat64 where applicable).

StatFs

Re-export statfs (or statfs64 where applicable).