MCPcopy
hub / github.com/coder/mux / getAtomicWriteTempPath

Function getAtomicWriteTempPath

src/node/runtime/atomicWriteTempPath.ts:16–21  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

14 * race on the same intermediate file or exceed filesystem name limits.
15 */
16export function getAtomicWriteTempPath(filePath: string): string {
17 const pidSuffix = process.pid.toString(36);
18 const timestampSuffix = Date.now().toString(36);
19 const randomSuffix = crypto.randomBytes(6).toString("hex");
20 return `${getSiblingDirectoryPrefix(filePath)}.mux-tmp.${pidSuffix}.${timestampSuffix}.${randomSuffix}`;
21}

Callers 4

writeFileFunction · 0.90
startFunction · 0.90
writeFileViaExecMethod · 0.90

Calls 1

Tested by

no test coverage detected