MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / safe_output_name

Function safe_output_name

app/workflow/file_sink.cpp:194–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192void write_artifact_output(
193 const std::filesystem::path & path,
194 const engine::runtime::VoiceArtifact & artifact) {
195 if (!path.parent_path().empty()) {
196 std::filesystem::create_directories(path.parent_path());
197 }
198 const auto tmp = path.parent_path() / (path.filename().string() + ".tmp");
199 std::filesystem::remove(tmp);
200 std::ofstream output(tmp, std::ios::binary);
201 if (!output) {
202 throw std::runtime_error("failed to open artifact output: " + tmp.string());
203 }
204 output.write(
205 reinterpret_cast<const char *>(artifact.payload.data()),

Callers 3

mainFunction · 0.85
emit_task_resultFunction · 0.85
emit_batch_item_resultFunction · 0.85

Calls 2

sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected