MCPcopy Create free account
hub / github.com/1jehuang/jcode / read_text

Function read_text

scripts/jcode_memory_snapshot.py:69–75  ·  view source on GitHub ↗
(path: Path, binary: bool = False)

Source from the content-addressed store, hash-verified

67
68
69def read_text(path: Path, binary: bool = False) -> str | None:
70 try:
71 if binary:
72 return path.read_bytes().replace(b"\x00", b" ").decode("utf-8", "ignore").strip()
73 return path.read_text().strip()
74 except Exception:
75 return None
76
77
78def read_argv(path: Path) -> list[str] | None:

Callers 3

parse_smaps_rollupFunction · 0.85
tokenize_slots_parallelFunction · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected