diff options
Diffstat (limited to 'ext/node/polyfills')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_ftruncate.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/polyfills/_fs/_fs_ftruncate.ts b/ext/node/polyfills/_fs/_fs_ftruncate.ts index 8a00cac4c..71186e868 100644 --- a/ext/node/polyfills/_fs/_fs_ftruncate.ts +++ b/ext/node/polyfills/_fs/_fs_ftruncate.ts @@ -4,6 +4,7 @@ // deno-lint-ignore-file prefer-primordials import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts"; +import { FsFile } from "ext:deno_fs/30_fs.js"; export function ftruncate( fd: number, @@ -19,9 +20,9 @@ export function ftruncate( if (!callback) throw new Error("No callback function supplied"); - Deno.ftruncate(fd, len).then(() => callback(null), callback); + new FsFile(fd).truncate(len).then(() => callback(null), callback); } export function ftruncateSync(fd: number, len?: number) { - Deno.ftruncateSync(fd, len); + new FsFile(fd).truncateSync(len); } |