diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/node/polyfills/_fs/_fs_fstat.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/polyfills/_fs/_fs_fstat.ts b/ext/node/polyfills/_fs/_fs_fstat.ts index bc4cf3c42..fe97235bf 100644 --- a/ext/node/polyfills/_fs/_fs_fstat.ts +++ b/ext/node/polyfills/_fs/_fs_fstat.ts @@ -11,6 +11,7 @@ import { statOptions, Stats, } from "ext:deno_node/_fs/_fs_stat.ts"; +import { FsFile } from "ext:deno_fs/30_fs.js"; export function fstat(fd: number, callback: statCallback): void; export function fstat( @@ -40,7 +41,7 @@ export function fstat( if (!callback) throw new Error("No callback function supplied"); - Deno.fstat(fd).then( + new FsFile(fd).stat().then( (stat) => callback(null, CFISBIS(stat, options.bigint)), (err) => callback(err), ); @@ -59,6 +60,6 @@ export function fstatSync( fd: number, options?: statOptions, ): Stats | BigIntStats { - const origin = Deno.fstatSync(fd); + const origin = new FsFile(fd).statSync(); return CFISBIS(origin, options?.bigint || false); } |