* 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)
| 76 | * Windows (libuv's UV_FS_O_EXLOCK): SQLite then can't open it at all. |
| 77 | */ |
| 78 | function 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: |
no test coverage detected