MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / holdExclusively

Function holdExclusively

__tests__/sqlite-open-error.test.ts:78–81  ·  view source on GitHub ↗

* Hold `file` open with no sharing, as a backup or antivirus scan can on * Windows (libuv's UV_FS_O_EXLOCK): SQLite then can't open it at all.

(file: string)

Source from the content-addressed store, hash-verified

76 * Windows (libuv's UV_FS_O_EXLOCK): SQLite then can't open it at all.
77 */
78function holdExclusively(file: string): void {
79 const fd = fs.openSync(file, fs.constants.O_RDWR | 0x10000000);
80 cleanups.push(() => fs.closeSync(fd));
81}
82
83/**
84 * Lock the database from another connection so that no other can read it:

Callers 1

Calls 2

pushMethod · 0.80
openSyncMethod · 0.45

Tested by

no test coverage detected