- Version: v11.3.0
- Platform: Win 10
Test case:
varfs=require('fs').promises;asyncfunctionbug(){awaitfs.writeFile('test','012345678901234567890123456789');constfd=awaitfs.open('test','r+');awaitfd.readFile({encoding: 'utf8'});awaitfd.truncate(0);awaitfd.writeFile('Extra data not at beginning');awaitfd.close();}bug();This will result a file with lots of '\0' at beginning of the file.
And w/o the ability to seek, there is no way to write at the beginning of the file.
Test case:
This will result a file with lots of '\0' at beginning of the file.
And w/o the ability to seek, there is no way to write at the beginning of the file.