[#BloombergLP-bdls-FilesystemUtil-open-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::open :relfileprefix: ../../../ :mrdocs: Open the file at the specified `path` according to the given policies. == Synopsis Declared in `<bdls_filesystemutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_TYPE> static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FilesystemUtil::FileDescriptor] open( STRING_TYPE const& path, xref:BloombergLP/bdls/FilesystemUtil/FileOpenPolicy.adoc[FileOpenPolicy] openPolicy, xref:BloombergLP/bdls/FilesystemUtil/FileIOPolicy.adoc[FileIOPolicy] ioPolicy, xref:BloombergLP/bdls/FilesystemUtil/FileTruncatePolicy.adoc[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 [cols="1,4"] |=== | Name| Description | *path* | filesystem path of the file to open | *openPolicy* | whether to open an existing file or create a new one | *ioPolicy* | whether the file is opened for reading, writing, or both | *truncatePolicy* | whether to delete existing contents on open |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#