BloombergLP::bdls::FilesystemUtil

This struct provides a namespace for utility functions dealing with platform-independent filesystem access.

Synopsis

Declared in <bdls_filesystemutil.h>

struct FilesystemUtil;

Type Aliases

NameDescription
FileDescriptor FileDescriptor is an alias for the operating system's native file descriptor / file handle type.
Offset Offset is an alias for a signed value, representing the offset of a location within a file.

Enums

NameDescription
Unnamed enum Default growth increment for file operations.
ErrorType Enumeration of error codes returned by certain filesystem operations.
FileIOPolicy Enumeration used to distinguish between different sets of actions permitted on an open file descriptor.
FileOpenPolicy Enumeration used to determine whether 'open' should open an existing file, or create a new file.
FileTruncatePolicy Enumeration used to distinguish between different ways to handle the contents, if any, of an existing file immediately upon opening the file.
Whence Enumeration used to distinguish among different starting points for a seek operation.

Static Member Functions

NameDescription
close Close the specified descriptor.
createDirectories Create any directories in the specified path that do not exist.
createPrivateDirectory Create a private directory with the specified path.
createTemporaryDirectory Create a new temporary directory with a name based on prefix.
createTemporaryFile Create and open a new temporary file with a name based on prefix.
createTemporarySubdirectory Create a new temporary directory under rootDirectory.
exists Return true if a file or directory currently exists at path.
findMatchingPaths Load into result all filesystem paths matching pattern.
getAvailableSpace getAvailableSpace overloads
getFileSize getFileSize overloads
getFileSizeLimit Return the file size limit for this process.
getLastModificationTime getLastModificationTime overloads
getSymbolicLinkTarget Load into result the target of the symbolic link at path.
getSystemTemporaryDirectory Load a valid path to the system temporary directory into path.
getWorkingDirectory Load into path the absolute pathname of the current working directory.
growFile Grow the file with descriptor to at least the specified size.
isDirectory isDirectory overloads
isRegularFile Return true if a regular file currently exists at path.
isSymbolicLink Return true if a symbolic link currently exists at path.
lock Acquire a lock for the file with the specified descriptor.
makeUnsafeTemporaryFilename Construct a temporary file name by appending a suffix to prefix.
map Map a region of the file with descriptor into memory.
mapChecked Map a region of the file with descriptor, rejecting past-EOF maps.
move Move the file or directory at oldPath to newPath.
open Open the file at the specified path according to the given policies.
read Read numBytes from the file with descriptor into buffer.
remove Remove the file or directory at the specified path.
rollFileChain Roll the file chain at path so that path becomes path.1.
seek Set the file pointer associated with descriptor according to whence.
setWorkingDirectory Set the working directory of the current process to the specified path.
sync Synchronize mapped memory at address with the underlying file.
truncateFileSize Set the size of the file referred to by descriptor to size.
tryLock Acquire a lock for the file with descriptor if it is available.
unlock Release any lock this process holds on the file with descriptor.
unmap Unmap the memory mapping with the specified address and size.
visitPaths Call visitor for each filesystem path matching the specified pattern.
visitTree Recursively visit files under root whose leaf names match pattern.
write Write numBytes from buffer to the file with descriptor.

Static Data Members

NameDescription
k_INVALID_FD FileDescriptor value representing no file, used as the error return for open.
k_OFFSET_MAX maximum representable file offset value
k_OFFSET_MIN minimum representable file offset value