(file)
| 3501 | } |
| 3502 | |
| 3503 | async function deleteFile(file) |
| 3504 | { |
| 3505 | await assertWritablePath(file); |
| 3506 | |
| 3507 | // Reading the header of the file to confirm it is a file we can delete |
| 3508 | let fh = await fsProm.open(file, O_RDONLY); |
| 3509 | let buffer = Buffer.allocUnsafe(16); |
| 3510 | await fh.read(buffer, 0, 16); |
| 3511 | await fh.close(); |
| 3512 | |
| 3513 | if (checkFileContent(buffer)) |
| 3514 | { |
| 3515 | await fsProm.unlink(file); |
| 3516 | } |
| 3517 | } |
| 3518 | |
| 3519 | function windowAction(method) |
| 3520 | { |
no test coverage detected