Create an output stream for OutputFileName and pass it to Write.
Declared in <llvm/Support/raw_ostream.h>
Error
writeToOutput(
StringRef OutputFileName,
std::function<Error(raw_ostream&)> Write);
The stream created is based on the specified OutputFileName: llvm::outs for "-", raw_null_ostream for "/dev/null", and raw_fd_ostream for other names. For raw_fd_ostream instances, the stream writes to a temporary file. The final output file is atomically replaced with the temporary file after the Write function is finished.
Success, or the error from opening the file or from Write.
| Name | Description |
|---|---|
| OutputFileName | Path or special name ("-" / "/dev/null") to write. |
| Write | Callback that receives the stream and returns an Error. |