diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-01-25 04:53:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 18:53:20 +0100 |
commit | 48c19d0bab5c1977e0d61a83d8e13c2bc26ef398 (patch) | |
tree | 5994613fa018602921d8eeaf57558aa5343095fa /ext/node/polyfills/_fs/_fs_fstat.ts | |
parent | abaffad028ab1d7fb71f7d4cc5ade94f99d0b11e (diff) |
feat: deprecate `Deno.fstat()` and `Deno.fstatSync()` (#22068)
For removal in Deno v2.
Diffstat (limited to 'ext/node/polyfills/_fs/_fs_fstat.ts')
-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); } |