MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / file_bytes

Function file_bytes

tools/materialize-bench/imported_guest.py:75–83  ·  view source on GitHub ↗
(path, mode)

Source from the content-addressed store, hash-verified

73
74
75def file_bytes(path, mode):
76 metadata = path.lstat()
77 if mode == '120000':
78 if not stat.S_ISLNK(metadata.st_mode):
79 raise ValueError('not a symlink: ' + str(path))
80 return os.fsencode(os.readlink(path))
81 if not stat.S_ISREG(metadata.st_mode) or bool(metadata.st_mode & 0o111) != (mode == '100755'):
82 raise ValueError('wrong kind or mode: ' + str(path))
83 return path.read_bytes()
84
85
86def verify_checkout(repo, manifest):

Callers 1

verify_checkoutFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected