ΒΆExpected<llvm::sys::fs::file_t> openNativeFile(
    const llvm::Twine& Name,
    llvm::sys::fs::CreationDisposition Disp,
    llvm::sys::fs::FileAccess Access,
    llvm::sys::fs::OpenFlags Flags,
    unsigned int Mode = 438)

Description

Opens a file with the specified creation disposition, access mode, and flags and returns a platform-specific file object.

The caller is responsible for closing the file object once they are finished with it.

Declared at: llvm/include/llvm/Support/FileSystem.h:983

Parameters

const llvm::Twine& Name
The path of the file to open, relative or absolute.
llvm::sys::fs::CreationDisposition Disp
Value specifying the existing-file behavior.
llvm::sys::fs::FileAccess Access
Value specifying whether to open the file in read, write, or read-write mode.
llvm::sys::fs::OpenFlags Flags
Additional flags.
unsigned int Mode = 438
The access permissions of the file, represented in octal.

Returns

errc::success if \a Name has been opened, otherwise a platform-specific error_code.