[#BloombergLP-bdls-FilesystemUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::FilesystemUtil :relfileprefix: ../../ :mrdocs: This `struct` provides a namespace for utility functions dealing with platform‐independent filesystem access. == Synopsis Declared in `<bdls_filesystemutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct FilesystemUtil; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[`FileDescriptor`] | `FileDescriptor` is an alias for the operating system's native file descriptor / file handle type. | xref:BloombergLP/bdls/FilesystemUtil/Offset.adoc[`Offset`] | `Offset` is an alias for a signed value, representing the offset of a location within a file. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil/_04enum.adoc[`Unnamed enum`] | Default growth increment for file operations. | xref:BloombergLP/bdls/FilesystemUtil/ErrorType.adoc[`ErrorType`] | Enumeration of error codes returned by certain filesystem operations. | xref:BloombergLP/bdls/FilesystemUtil/FileIOPolicy.adoc[`FileIOPolicy`] | Enumeration used to distinguish between different sets of actions permitted on an open file descriptor. | xref:BloombergLP/bdls/FilesystemUtil/FileOpenPolicy.adoc[`FileOpenPolicy`] | Enumeration used to determine whether 'open' should open an existing file, or create a new file. | xref:BloombergLP/bdls/FilesystemUtil/FileTruncatePolicy.adoc[`FileTruncatePolicy`] | Enumeration used to distinguish between different ways to handle the contents, if any, of an existing file immediately upon opening the file. | xref:BloombergLP/bdls/FilesystemUtil/Whence.adoc[`Whence`] | Enumeration used to distinguish among different starting points for a seek operation. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil/close.adoc[`close`] | Close the specified `descriptor`. | xref:BloombergLP/bdls/FilesystemUtil/createDirectories-04.adoc[`createDirectories`] | Create any directories in the specified `path` that do not exist. | xref:BloombergLP/bdls/FilesystemUtil/createPrivateDirectory-0e.adoc[`createPrivateDirectory`] | Create a private directory with the specified `path`. | xref:BloombergLP/bdls/FilesystemUtil/createTemporaryDirectory-04.adoc[`createTemporaryDirectory`] | Create a new temporary directory with a name based on `prefix`. | xref:BloombergLP/bdls/FilesystemUtil/createTemporaryFile-08.adoc[`createTemporaryFile`] | Create and open a new temporary file with a name based on `prefix`. | xref:BloombergLP/bdls/FilesystemUtil/createTemporarySubdirectory-00.adoc[`createTemporarySubdirectory`] | Create a new temporary directory under `rootDirectory`. | xref:BloombergLP/bdls/FilesystemUtil/exists-056.adoc[`exists`] | Return `true` if a file or directory currently exists at `path`. | xref:BloombergLP/bdls/FilesystemUtil/findMatchingPaths-065e.adoc[`findMatchingPaths`] | Load into `result` all filesystem paths matching `pattern`. | xref:BloombergLP/bdls/FilesystemUtil/getAvailableSpace-01.adoc[`getAvailableSpace`] | `getAvailableSpace` overloads | xref:BloombergLP/bdls/FilesystemUtil/getFileSize-0d.adoc[`getFileSize`] | `getFileSize` overloads | xref:BloombergLP/bdls/FilesystemUtil/getFileSizeLimit.adoc[`getFileSizeLimit`] | Return the file size limit for this process. | xref:BloombergLP/bdls/FilesystemUtil/getLastModificationTime-09.adoc[`getLastModificationTime`] | `getLastModificationTime` overloads | xref:BloombergLP/bdls/FilesystemUtil/getSymbolicLinkTarget-0fb.adoc[`getSymbolicLinkTarget`] | Load into `result` the target of the symbolic link at `path`. | xref:BloombergLP/bdls/FilesystemUtil/getSystemTemporaryDirectory-077.adoc[`getSystemTemporaryDirectory`] | Load a valid path to the system temporary directory into `path`. | xref:BloombergLP/bdls/FilesystemUtil/getWorkingDirectory-01.adoc[`getWorkingDirectory`] | Load into `path` the absolute pathname of the current working directory. | xref:BloombergLP/bdls/FilesystemUtil/growFile.adoc[`growFile`] | Grow the file with `descriptor` to at least the specified `size`. | xref:BloombergLP/bdls/FilesystemUtil/isDirectory-02.adoc[`isDirectory`] | `isDirectory` overloads | xref:BloombergLP/bdls/FilesystemUtil/isRegularFile-0a.adoc[`isRegularFile`] | Return `true` if a regular file currently exists at `path`. | xref:BloombergLP/bdls/FilesystemUtil/isSymbolicLink-09.adoc[`isSymbolicLink`] | Return `true` if a symbolic link currently exists at `path`. | xref:BloombergLP/bdls/FilesystemUtil/lock.adoc[`lock`] | Acquire a lock for the file with the specified `descriptor`. | xref:BloombergLP/bdls/FilesystemUtil/makeUnsafeTemporaryFilename-09.adoc[`makeUnsafeTemporaryFilename`] | Construct a temporary file name by appending a suffix to `prefix`. | xref:BloombergLP/bdls/FilesystemUtil/map.adoc[`map`] | Map a region of the file with `descriptor` into memory. | xref:BloombergLP/bdls/FilesystemUtil/mapChecked.adoc[`mapChecked`] | Map a region of the file with `descriptor`, rejecting past‐EOF maps. | xref:BloombergLP/bdls/FilesystemUtil/move-0d.adoc[`move`] | Move the file or directory at `oldPath` to `newPath`. | xref:BloombergLP/bdls/FilesystemUtil/open-0f.adoc[`open`] | Open the file at the specified `path` according to the given policies. | xref:BloombergLP/bdls/FilesystemUtil/read.adoc[`read`] | Read `numBytes` from the file with `descriptor` into `buffer`. | xref:BloombergLP/bdls/FilesystemUtil/remove-0e.adoc[`remove`] | Remove the file or directory at the specified `path`. | xref:BloombergLP/bdls/FilesystemUtil/rollFileChain.adoc[`rollFileChain`] | Roll the file chain at `path` so that `path` becomes `path.1`. | xref:BloombergLP/bdls/FilesystemUtil/seek.adoc[`seek`] | Set the file pointer associated with `descriptor` according to `whence`. | xref:BloombergLP/bdls/FilesystemUtil/setWorkingDirectory-00.adoc[`setWorkingDirectory`] | Set the working directory of the current process to the specified `path`. | xref:BloombergLP/bdls/FilesystemUtil/sync.adoc[`sync`] | Synchronize mapped memory at `address` with the underlying file. | xref:BloombergLP/bdls/FilesystemUtil/truncateFileSize.adoc[`truncateFileSize`] | Set the size of the file referred to by `descriptor` to `size`. | xref:BloombergLP/bdls/FilesystemUtil/tryLock.adoc[`tryLock`] | Acquire a lock for the file with `descriptor` if it is available. | xref:BloombergLP/bdls/FilesystemUtil/unlock.adoc[`unlock`] | Release any lock this process holds on the file with `descriptor`. | xref:BloombergLP/bdls/FilesystemUtil/unmap.adoc[`unmap`] | Unmap the memory mapping with the specified `address` and `size`. | xref:BloombergLP/bdls/FilesystemUtil/visitPaths-0f.adoc[`visitPaths`] | Call `visitor` for each filesystem path matching the specified `pattern`. | xref:BloombergLP/bdls/FilesystemUtil/visitTree.adoc[`visitTree`] | Recursively visit files under `root` whose leaf names match `pattern`. | xref:BloombergLP/bdls/FilesystemUtil/write.adoc[`write`] | Write `numBytes` from `buffer` to the file with `descriptor`. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdls/FilesystemUtil/k_INVALID_FD.adoc[`k_INVALID_FD`] | `FileDescriptor` value representing no file, used as the error return for `open`. | xref:BloombergLP/bdls/FilesystemUtil/k_OFFSET_MAX.adoc[`k_OFFSET_MAX`] | maximum representable file offset value | xref:BloombergLP/bdls/FilesystemUtil/k_OFFSET_MIN.adoc[`k_OFFSET_MIN`] | minimum representable file offset value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#