(path, len = 0)
| 1515 | } |
| 1516 | |
| 1517 | async function truncate(path, len = 0) { |
| 1518 | const h = vfsState.handlers; |
| 1519 | if (h !== null) { |
| 1520 | const promise = h.truncate(path, len); |
| 1521 | if (promise !== undefined) { await promise; return; } |
| 1522 | } |
| 1523 | const fd = await open(path, 'r+'); |
| 1524 | return handleFdClose(ftruncate(fd, len), fd.close); |
| 1525 | } |
| 1526 | |
| 1527 | async function ftruncate(handle, len = 0) { |
| 1528 | validateInteger(len, 'len'); |
no test coverage detected
searching dependent graphs…