Filesystem path and open‐flag helpers.

Types

Name

Description

FileLocker

RAII lock holding an exclusive lock on an open file.

TempFile

Represents a temporary file.

UniqueID

Stable identifier for a filesystem object, composed of device and inode.

basic_file_status

Subset of file status available from directory iteration.

directory_entry

directory_entry ‐ A single entry in a directory.

directory_iterator

Iterates through the entries in a directory.

file_status

Represents the result of a call to sys::fs::status().

mapped_file_region

This class represents a memory mapped file. It is based on boost::iostreams::mapped_file.

recursive_directory_iterator

recursive_directory_iterator ‐ Same as directory_iterator except for it recurses down into child directories.

space_info

Disk capacity and free‐space statistics for a filesystem.

Type Aliases

Name

Description

file_t

Native file handle type for the host platform.

Enums

Name

Description

Unnamed enum

Default chunk size for readNativeFileToEOF().

AccessMode

Access check requested by access().

CreationDisposition

Flags controlling whether an existing file is truncated or created.

FileAccess

Access mode flags for opening a file.

LockKind

An enumeration for the lock kind.

OpenFlags

Flags controlling how a file is opened for writing.

file_type

An enumeration for the file system's view of the type.

perms

POSIX‐style permission bits for filesystem objects.

Functions

Name

Description

access

Can the file be accessed?

can_execute

Can we execute this file?

can_write

Can we write this file?

changeFileOwnership

Change ownership of a file.

closeFile

Close the file object.

convertFDToNativeFile

Converts from a Posix file descriptor number to a native file handle.

copy_file

Copy the contents of From to To.

createTemporaryFile

createTemporaryFile overloads

createUniqueDirectory

Create a unique directory whose name starts with Prefix.

createUniqueFile

createUniqueFile overloads

createUniquePath

Create a potentially unique file name but does not create it.

create_directories

Create all the non‐existent directories in path.

create_directory

Create the directory in path.

create_hard_link

Create a hard link from from to to, or return an error.

create_link

Create a link from from to to.

create_symlink

Create a symbolic link from from to to.

current_path

Get the current path.

disk_space

Get disk space usage information.

equivalent

equivalent overloads

exists

Does file exist?

expand_tilde

Expands ~ expressions to the user's home directory. On Unix ~user directories are resolved as well.

file_size

Get file size.

getMainExecutable

Return the path to the main executable.

getPermissions

Get file permissions.

getPotentiallyUniqueFileName

Get a unique name, not currently exisiting in the filesystem. Subject to race conditions, prefer to use createUniqueFile instead.

getPotentiallyUniqueTempFileName

Get a unique temporary file name, not currently exisiting in the filesystem. Subject to race conditions, prefer to use createTemporaryFile instead.

getStderrHandle

Return an open handle to standard error. On Unix, this is typically FD 2. Returns kInvalidFile when the stream is closed.

getStdinHandle

Return an open handle to standard in. On Unix, this is typically FD 0. Returns kInvalidFile when the stream is closed.

getStdoutHandle

Return an open handle to standard out. On Unix, this is typically FD 1. Returns kInvalidFile when the stream is closed.

getUmask

Get file creation mode mask of the process.

getUniqueID

Fill Result with the unique ID of the filesystem object at Path.

get_file_type

Does status represent a directory?

is_directory

is_directory overloads

is_local

is_local overloads

is_other

is_other overloads

is_regular_file

is_regular_file overloads

is_symlink_file

is_symlink_file overloads

lockFile

Lock the file.

make_absolute

Make path an absolute path.

md5_contents

md5_contents overloads

openFile

Opens a file with the specified creation disposition, access mode, and flags and returns a file descriptor.

openFileForRead

Opens the file with the given name in a read‐only mode, returning its open file descriptor.

openFileForReadWrite

Opens the file for read‐write, creating it if it does not exist.

openFileForWrite

Opens the file for write, creating it if it does not exist.

openNativeFile

Opens a file with the specified creation disposition, access mode, and flags and returns a platform‐specific file object.

openNativeFileForRead

Opens the file with the given name in a read‐only mode, returning its open file descriptor.

openNativeFileForReadWrite

Opens the file for read‐write, creating it if it does not exist.

openNativeFileForWrite

Opens the file for write, creating it if it does not exist.

operator&

Bitwise AND of permission bitmasks l and r.

operator&=

AND‐assign permission bits from r into l.

operator|

Bitwise disjunction operators

operator|=

Bitwise disjunction assignment operators

operator~

Bitwise complement of permission mask x.

readNativeFile

Read bytes from a native file handle into a buffer.

readNativeFileSlice

Read bytes from a native file handle at a given offset.

readNativeFileToEOF

Reads from FileHandle until EOF, appending to Buffer in chunks of size ChunkSize.

readlink

Read the target of a symbolic link.

real_path

Collapse all . and .. patterns, resolve all symlinks, and optionally expand ~ expressions to the user's home directory.

remove

Remove path. Equivalent to POSIX remove().

remove_directories

Recursively delete a directory.

rename

Rename from to to.

resize_file

Resize path to size. File is resized as if by POSIX truncate().

resize_file_before_mapping_readwrite

Resize a file before mapping it read‐write.

resize_file_sparse

Resize a file with sparse files explicitly enabled.

setLastAccessAndModificationTime

setLastAccessAndModificationTime overloads

setPermissions

setPermissions overloads

set_current_path

Set the current path.

status

status overloads

status_known

Is status available?

tryLockFile

Try to locks the file during the specified time.

unlockFile

Unlock the file.

Variables

Name

Description

kInvalidFile

Sentinel value representing an invalid file handle.

Created with MrDocs