ΒΆinline Expected<llvm::sys::fs::file_t>
openNativeFileForWrite(
const llvm::Twine& Name,
llvm::sys::fs::CreationDisposition Disp,
llvm::sys::fs::OpenFlags Flags,
unsigned int Mode = 438)
inline Expected<llvm::sys::fs::file_t>
openNativeFileForWrite(
const llvm::Twine& Name,
llvm::sys::fs::CreationDisposition Disp,
llvm::sys::fs::OpenFlags Flags,
unsigned int Mode = 438)
Description
Opens the file with the given name in a write-only or read-write mode, returning its open file descriptor. If the file does not exist, it is created.
The caller is responsible for closing the freeing the file once they are finished with it.
Declared at: llvm/include/llvm/Support/FileSystem.h:1051
Parameters
- const llvm::Twine& Name
- The path of the file to open, relative or absolute.
- llvm::sys::fs::CreationDisposition Disp
- llvm::sys::fs::OpenFlags Flags
- Additional flags used to determine whether the file should be opened in, for example, read-write or in write-only mode.
- unsigned int Mode = 438
- The access permissions of the file, represented in octal.
Returns
a platform-specific file descriptor if \a Name has been opened, otherwise an error object.