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

Method readFile

daemon/src/service/system_file.ts:206–212  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

204 }
205
206 async readFile(fileName: string) {
207 if (!this.check(fileName)) throw new Error(ERROR_MSG_01);
208 const absPath = this.toAbsolutePath(fileName);
209 const buf = await fs.readFile(absPath);
210 const text = iconv.decode(buf, this.fileCode || "utf-8");
211 return text;
212 }
213
214 async writeFile(fileName: string, data: string) {
215 if (!this.check(fileName)) throw new Error(ERROR_MSG_01);

Callers 6

editMethod · 0.95
readFileWithSudoFunction · 0.45
readCategoryConfigFunction · 0.45
onStartMethod · 0.45
Instance_router.tsFile · 0.45
http_router.tsFile · 0.45

Calls 2

checkMethod · 0.95
toAbsolutePathMethod · 0.95

Tested by

no test coverage detected