mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 10:43:30 +00:00
Fixes #6212. Parse effective argfile syntax once, admit bounded regular files with retained cleanup/cancellation ownership, freeze validated bytes for subsequent helpers and analysis launch, and share existing private-runtime writing. Resolves the continuation, FIFO and mutable-source review findings. Verified 97 related tests (3 explicit skips), full static/docs checks, two independent local Codex reviews and 12 real installed-JDK17 grammar/property controls. Real Ghidra, JDK25 and native Windows qualification remain unavailable. Used the explicitly authorized maintainer bypass: current GitHub CI remained queued and Greptile rerun was still in progress; author-readiness metadata was not fabricated. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
17 lines
613 B
TypeScript
17 lines
613 B
TypeScript
import { basename, dirname } from "node:path";
|
|
import writeFileAtomic from "write-file-atomic";
|
|
import { windowsPrivateRuntime } from "../windows/WindowsPrivateRuntime.js";
|
|
|
|
/** Runtime-owned configuration text: private native handle on Windows, private atomic write on POSIX. */
|
|
export const writeGhidraRuntimeFile = async (
|
|
path: string,
|
|
content: string,
|
|
platform: NodeJS.Platform,
|
|
): Promise<void> => {
|
|
if (platform === "win32") {
|
|
windowsPrivateRuntime(dirname(path)).writeFile(basename(path), content);
|
|
return;
|
|
}
|
|
await writeFileAtomic(path, content, { encoding: "utf8", mode: 0o600 });
|
|
};
|