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

Method chmod

daemon/src/service/system_file.ts:193–204  ·  view source on GitHub ↗
(fileName: string, chmodValue: number, deep: boolean)

Source from the content-addressed store, hash-verified

191 }
192
193 async chmod(fileName: string, chmodValue: number, deep: boolean) {
194 if (!this.check(fileName) || isNaN(parseInt(chmodValue as any))) throw new Error(ERROR_MSG_01);
195 const absPath = this.toAbsolutePath(fileName);
196 const defaultPath = "/bin/chmod";
197 let file = "chmod";
198 if (fs.existsSync(defaultPath)) file = defaultPath;
199 const params: string[] = [];
200 if (deep) params.push("-R");
201 params.push(String(chmodValue));
202 params.push(absPath);
203 return await new ProcessWrapper(file, params, ".", 60 * 10).start();
204 }
205
206 async readFile(fileName: string) {
207 if (!this.check(fileName)) throw new Error(ERROR_MSG_01);

Callers 4

downloadSteamFunction · 0.80
check7zipStatusFunction · 0.80
onStartMethod · 0.80
file_router.tsFile · 0.80

Calls 4

checkMethod · 0.95
toAbsolutePathMethod · 0.95
startMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected