(fileName: string, chmodValue: number, deep: boolean)
| 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); |
no test coverage detected