Publish immutable result files without exposing partial contents. More...
#include "application_runtime.h"

Go to the source code of this file.
Functions | |
| void | saveBinary (const fs::path &path, const void *data, std::size_t size) |
| Write bytes to a new path and publish them by same-directory rename. | |
Detailed Description
Publish immutable result files without exposing partial contents.
A sibling temporary file allows readers to see either no result or the complete renamed result. Existing targets are rejected because survey products are evidence; silently replacing one could conceal a prior run. This helper provides atomic visibility on the same filesystem, not an fsync durability guarantee.
Definition in file binary_output.h.
Function Documentation
◆ saveBinary()
|
inline |
Write bytes to a new path and publish them by same-directory rename.
- Parameters
-
[in] path Final output path; it and its .partial sibling must not exist. [in] data Address of the bytes to write; may be null only when sizeis zero.[in] size Number of bytes to publish.
- Exceptions
-
std::runtime_error If output exists, writing fails, or rename fails.
- Note
- Rename prevents readers from observing a partially written target; use the durable checkpoint helpers when crash/power-loss durability matters.
Definition at line 41 of file binary_output.h.