From 2f47ec6c3a583c8323a06c386feeaee4fbf75edc Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Wed, 24 Jan 2024 10:31:52 +1100 Subject: feat: `Deno.FsFile.dataSync()` and `Deno.FsFile.dataSyncSync()` (#22019) This change: 1. Implements `Deno.FsFile.dataSync()` and `Deno.FsFile.dataSyncSync()`. 2. Deprecates `Deno.fdatasync()` and `Deno.fdatasyncSync()` for removal in Deno v2, in favour of the above corresponding methods. 3. Replaces use of `Deno.fdatasync()` and `Deno.fdatasyncSync()` with the above instance methods. Related #21995 --- ext/node/polyfills/_fs/_fs_fdatasync.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/node/polyfills') diff --git a/ext/node/polyfills/_fs/_fs_fdatasync.ts b/ext/node/polyfills/_fs/_fs_fdatasync.ts index f6ed4a39b..482b4378c 100644 --- a/ext/node/polyfills/_fs/_fs_fdatasync.ts +++ b/ext/node/polyfills/_fs/_fs_fdatasync.ts @@ -4,14 +4,15 @@ // 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 fdatasync( fd: number, callback: CallbackWithError, ) { - Deno.fdatasync(fd).then(() => callback(null), callback); + new FsFile(fd).dataSync().then(() => callback(null), callback); } export function fdatasyncSync(fd: number) { - Deno.fdatasyncSync(fd); + new FsFile(fd).dataSyncSync(); } -- cgit v1.2.3