Skip to content

Commit

Permalink
test: address deprecation warning
Browse files Browse the repository at this point in the history
fs.truncateSync() emits a deprecation warning when called with a file
descriptor. Move to fs.ftruncateSync().
  • Loading branch information
Trott committed Apr 28, 2021
1 parent 7e85629 commit c5bc80a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sequential/test-fs-largefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const fd = fs.openSync(filepath, 'w+');
const offset = 5 * 1024 * 1024 * 1024; // 5GB
const message = 'Large File';

fs.truncateSync(fd, offset);
fs.ftruncateSync(fd, offset);
assert.strictEqual(fs.statSync(filepath).size, offset);
const writeBuf = Buffer.from(message);
fs.writeSync(fd, writeBuf, 0, writeBuf.length, offset);
Expand Down

0 comments on commit c5bc80a

Please sign in to comment.