(target: string, data?: string)
| 288 | } |
| 289 | |
| 290 | async edit(target: string, data?: string) { |
| 291 | if (!this.check(target)) throw new Error(ERROR_MSG_01); |
| 292 | if (data || typeof data === "string") { |
| 293 | return await this.writeFile(target, data); |
| 294 | } else { |
| 295 | const absPath = this.toAbsolutePath(target); |
| 296 | const info = fs.statSync(absPath); |
| 297 | if (info.size > MAX_EDIT_SIZE) { |
| 298 | throw new Error($t("TXT_CODE_system_file.execLimit")); |
| 299 | } |
| 300 | return await this.readFile(target); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | rename(target: string, newName: string) { |
| 305 | if (!this.check(target)) throw new Error(ERROR_MSG_01); |
no test coverage detected