Opens the file for write, creating it if it does not exist.
Declared in <llvm/Support/FileSystem.h>
std::error_code
openFileForWrite(
Twine const& Name,
int& ResultFD,
CreationDisposition Disp = CD_CreateAlways,
OpenFlags Flags = OF_None,
unsigned int Mode = 0666);
The caller is responsible for closing the file descriptor once they are finished with it.
errc::success if Name has been opened, otherwise a platform-specific error_code.
| Name | Description |
|---|---|
| Name | The path of the file to open, relative or absolute. |
| ResultFD | If the file could be opened successfully, its descriptor is stored in this location. Otherwise, this is set to -1. |
| Disp | Value specifying the existing-file behavior. |
| Flags | Additional flags used to determine whether the file should be opened in, for example, read-write or in write-only mode. |
| Mode | The access permissions of the file, represented in octal. |