MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / _directory

Function _directory

scripts/test-impact/coverage_live_v2.py:53–68  ·  view source on GitHub ↗

Open each absolute component without following symlinks; caller closes.

(path)

Source from the content-addressed store, hash-verified

51
52
53def _directory(path):
54 """Open each absolute component without following symlinks; caller closes."""
55 path = os.path.abspath(path)
56 fd = os.open(os.sep, os.O_RDONLY | os.O_DIRECTORY)
57 try:
58 for part in path.split(os.sep):
59 if not part:
60 continue
61 next_fd = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW,
62 dir_fd=fd)
63 os.close(fd)
64 fd = next_fd
65 return fd
66 except BaseException:
67 os.close(fd)
68 raise
69
70
71def _regular(path):

Callers 6

_regularFunction · 0.85
__init__Method · 0.85
checkMethod · 0.85
writeMethod · 0.85
inventoryMethod · 0.85
collectFunction · 0.85

Calls 2

openMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected