| 526 | }, |
| 527 | |
| 528 | mkdirSync(dirPath, options) { |
| 529 | using _ = slowLogging`fs.mkdirSync(${dirPath})` |
| 530 | const mkdirOptions: { recursive: boolean; mode?: number } = { |
| 531 | recursive: true, |
| 532 | } |
| 533 | if (options?.mode !== undefined) { |
| 534 | mkdirOptions.mode = options.mode |
| 535 | } |
| 536 | try { |
| 537 | fs.mkdirSync(dirPath, mkdirOptions) |
| 538 | } catch (e) { |
| 539 | // Bun/Windows: recursive:true throws EEXIST on directories with the |
| 540 | // FILE_ATTRIBUTE_READONLY bit set (Group Policy, OneDrive, desktop.ini). |
| 541 | // Bun's directoryExistsAt misclassifies DIRECTORY+READONLY as not-a-dir |
| 542 | // (bun-internal src/sys.zig existsAtType). The dir exists; ignore. |
| 543 | // https://github.com/anthropics/claude-code/issues/30924 |
| 544 | if (getErrnoCode(e) !== 'EEXIST') throw e |
| 545 | } |
| 546 | }, |
| 547 | |
| 548 | readdirSync(dirPath) { |
| 549 | using _ = slowLogging`fs.readdirSync(${dirPath})` |