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().

PR-URL: #38448
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Trott authored and targos committed Jun 5, 2021
1 parent 1a293b0 commit fc4f1d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/pummel/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 fc4f1d1

Please sign in to comment.