MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / writeFile

Method writeFile

daemon/src/service/system_file.ts:214–219  ·  view source on GitHub ↗
(fileName: string, data: string)

Source from the content-addressed store, hash-verified

212 }
213
214 async writeFile(fileName: string, data: string) {
215 if (!this.check(fileName)) throw new Error(ERROR_MSG_01);
216 const absPath = this.toAbsolutePath(fileName);
217 const buf = iconv.encode(data, this.fileCode || "utf-8");
218 return await fs.writeFile(absPath, buf);
219 }
220
221 async newFile(fileName: string) {
222 // if (!FileManager.checkFileName(fileName)) throw new Error(ERROR_MSG_01);

Callers 4

editMethod · 0.95
readCategoryConfigFunction · 0.45

Calls 2

checkMethod · 0.95
toAbsolutePathMethod · 0.95

Tested by

no test coverage detected