[#BloombergLP-bdls-FilesystemUtil-open-0f] = 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. == Synopses Declared in `<bdls_filesystemutil.h>` Open the file at the specified `path` according to the given policies. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FileDescriptor] xref:BloombergLP/bdls/FilesystemUtil/open-01.adoc[open]( char 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); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/open-01.adoc[_» more..._]# Open the file at the specified `path` according to the given policies. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_TYPE> static xref:BloombergLP/bdls/FilesystemUtil/FileDescriptor.adoc[FilesystemUtil::FileDescriptor] xref:BloombergLP/bdls/FilesystemUtil/open-0a.adoc[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); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/open-0a.adoc[_» more..._]# == 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]#