MCPcopy
hub / github.com/jgraph/drawio-desktop / deleteFile

Function deleteFile

src/main/electron.js:3503–3517  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

3501}
3502
3503async 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
3519function windowAction(method)
3520{

Callers 2

createWindowFunction · 0.85
electron.jsFile · 0.85

Calls 3

assertWritablePathFunction · 0.85
checkFileContentFunction · 0.85
closeMethod · 0.80

Tested by

no test coverage detected