BloombergLP::bdls::FilesystemUtil::open

Open the file at the specified path according to the given policies.

Synopsis

Declared in <bdls_filesystemutil.h>

template<class STRING_TYPE>
static
FilesystemUtil::FileDescriptor
open(
    STRING_TYPE const& path,
    FileOpenPolicy openPolicy,
    FileIOPolicy ioPolicy,
    FileTruncatePolicy truncatePolicy = e_KEEP);

Description

Same as the overload taking const char *.

Return Value

a valid FileDescriptor on success, or k_INVALID_FD otherwise

Parameters

NameDescription
pathfilesystem path of the file to open
openPolicywhether to open an existing file or create a new one
ioPolicywhether the file is opened for reading, writing, or both
truncatePolicywhether to delete existing contents on open