MCPcopy
hub / github.com/codeaashu/claude-code / mkdir

Function mkdir

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

Source from the content-addressed store, hash-verified

412 },
413
414 async mkdir(dirPath, options) {
415 try {
416 await mkdirPromise(dirPath, { recursive: true, ...options })
417 } catch (e) {
418 // Bun/Windows: recursive:true throws EEXIST on directories with the
419 // FILE_ATTRIBUTE_READONLY bit set (Group Policy, OneDrive, desktop.ini).
420 // Bun's directoryExistsAt misclassifies DIRECTORY+READONLY as not-a-dir
421 // (bun-internal src/sys.zig existsAtType). The dir exists; ignore.
422 // https://github.com/anthropics/claude-code/issues/30924
423 if (getErrnoCode(e) !== 'EEXIST') throw e
424 }
425 },
426
427 async readFile(fsPath, options) {
428 return readFilePromise(fsPath, { encoding: options.encoding })

Callers 15

copySnapshotToLocalFunction · 0.85
saveSyncedMetaFunction · 0.85
MemoryFileSelectorFunction · 0.85
createBackupFunction · 0.85
restoreBackupFunction · 0.85
copyFileHistoryForResumeFunction · 0.85
ensureToolResultsDirFunction · 0.85
ensureImageStoreDirFunction · 0.85
extractPDFPagesFunction · 0.85
writeAgentMetadataFunction · 0.85
writeRemoteAgentMetadataFunction · 0.85

Calls 1

getErrnoCodeFunction · 0.85

Tested by

no test coverage detected