platform/node/atomic-file
Functions
Section titled “Functions”writeFileAtomic()
Section titled “writeFileAtomic()”writeFileAtomic(
path,data):Promise<void>
Defined in: app/src/platform/node/atomic-file.ts:12
Writes a file so that readers see either the old or the new content, never a partial file: the data goes to a temporary file, is flushed to disk and then renamed over the target.
Parameters
Section titled “Parameters”string
Target file.
string | Uint8Array<ArrayBufferLike>
New content.
Returns
Section titled “Returns”Promise<void>
writeFileAtomicSync()
Section titled “writeFileAtomicSync()”writeFileAtomicSync(
path,data):void
Defined in: app/src/platform/node/atomic-file.ts:30
Synchronous variant of writeFileAtomic, for shutdown and startup paths.
Parameters
Section titled “Parameters”string
Target file.
string | Uint8Array<ArrayBufferLike>
New content.
Returns
Section titled “Returns”void