( path: string, content: string, )
| 211 | } |
| 212 | |
| 213 | async function writePrivateFileExclusive( |
| 214 | path: string, |
| 215 | content: string, |
| 216 | ): Promise<void> { |
| 217 | const handle = await open(path, 'wx', 0o600) |
| 218 | try { |
| 219 | await handle.writeFile(content, 'utf-8') |
| 220 | } finally { |
| 221 | await handle.close() |
| 222 | } |
| 223 | await chmod(path, 0o600) |
| 224 | } |
| 225 | |
| 226 | async function ensureSocketParent(path: string): Promise<void> { |
| 227 | const dir = dirname(path) |
no test coverage detected