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

Function ensureSocketParent

src/utils/udsMessaging.ts:226–241  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

224}
225
226async function ensureSocketParent(path: string): Promise<void> {
227 const dir = dirname(path)
228 try {
229 const stat = await lstat(dir)
230 if (!stat.isDirectory() || stat.isSymbolicLink()) {
231 throw new Error(`[udsMessaging] socket parent is not a directory: ${dir}`)
232 }
233 assertPrivateDirectory(stat, dir, 'socket parent')
234 return
235 } catch (error) {
236 if (!isNotFound(error)) throw error
237 }
238
239 await mkdir(dir, { recursive: true, mode: 0o700 })
240 await chmod(dir, 0o700)
241}
242
243async function writeCapabilityFile(
244 socket: string,

Callers 1

startUdsMessagingFunction · 0.85

Calls 3

assertPrivateDirectoryFunction · 0.85
isNotFoundFunction · 0.85
mkdirFunction · 0.85

Tested by

no test coverage detected