MCPcopy
hub / github.com/claude-code-best/claude-code / mkdirSync

Function mkdirSync

src/utils/fsOperations.ts:528–546  ·  view source on GitHub ↗
(dirPath, options)

Source from the content-addressed store, hash-verified

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})`

Callers 15

writePerfettoTraceSyncFunction · 0.90
writeTeamFileFunction · 0.90
getPluginDataDirFunction · 0.90
createJobFunction · 0.90
templates.test.tsFile · 0.90
startMethod · 0.90
persistProjectContextFunction · 0.90
createGitRepoFunction · 0.90
writeDaemonStateFunction · 0.90

Calls 1

getErrnoCodeFunction · 0.85

Tested by 7

createGitRepoFunction · 0.72
writeTeamConfigFunction · 0.68
writeTeamConfigFunction · 0.68
writeSessionLogFunction · 0.68
writeSessionLogFunction · 0.68
makeLogWithToolCallsFunction · 0.68
runWithLogLinesFunction · 0.68