diff --git a/src/shared/write-file-atomically.ts b/src/shared/write-file-atomically.ts index 09ce5b7d5..7f6544761 100644 --- a/src/shared/write-file-atomically.ts +++ b/src/shared/write-file-atomically.ts @@ -16,7 +16,7 @@ export function writeFileAtomically( ): void { const tempPath = `${filePath}.tmp` writeFileSync(tempPath, content, "utf-8") - const tempFileDescriptor = openSync(tempPath, "r") + const tempFileDescriptor = openSync(tempPath, "r+") try { tolerantFsyncSync(tempFileDescriptor, `writeFileAtomically:${filePath}`, deps.fsyncSync) } finally {