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 <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Trott authored and targos committed Jun 11, 2021
1 parent 8258799 commit fdfb39e
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 fdfb39e

Please sign in to comment.