MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / writeFileAtomicSync

Function writeFileAtomicSync

src/daemon/daemon-registry.ts:153–165  ·  view source on GitHub ↗
(filePath: string, content: string)

Source from the content-addressed store, hash-verified

151}
152
153function writeFileAtomicSync(filePath: string, content: string): void {
154 const dir = dirname(filePath);
155 mkdirSync(dir, { recursive: true, mode: 0o700 });
156
157 const tempPath = join(dir, `.daemon.json.${process.pid}.${randomUUID()}.tmp`);
158 try {
159 writeFileSync(tempPath, content, { encoding: 'utf8', mode: 0o600 });
160 renameSync(tempPath, filePath);
161 } catch (error) {
162 rmSync(tempPath, { force: true });
163 throw error;
164 }
165}
166
167function withDaemonRegistryMutationLock<T>(
168 workspaceKey: string,

Callers 1

writeDaemonRegistryEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected