MCPcopy Index your code
hub / github.com/bugy/script-server / write_file

Function write_file

src/utils/file_utils.py:87–97  ·  view source on GitHub ↗
(filename, content, byte_content=False)

Source from the content-addressed store, hash-verified

85
86
87def write_file(filename, content, byte_content=False):
88 path = normalize_path(filename)
89
90 prepare_folder(os.path.dirname(path))
91
92 mode = "w"
93 if byte_content:
94 mode += "b"
95
96 with open(path, mode) as file:
97 file.write(content)
98
99
100def prepare_folder(folder_path):

Callers

nothing calls this directly

Calls 3

normalize_pathFunction · 0.85
prepare_folderFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected