summaryrefslogtreecommitdiff
path: root/ext/fs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fs')
-rw-r--r--ext/fs/30_fs.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index 277a1c73c..3c888f1f1 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { core, primordials } from "ext:core/mod.js";
+import { core, internals, primordials } from "ext:core/mod.js";
const {
isDate,
} = core;
@@ -558,10 +558,20 @@ async function symlink(
}
function fdatasyncSync(rid) {
+ internals.warnOnDeprecatedApi(
+ "Deno.fdatasyncSync()",
+ new Error().stack,
+ "Use `file.dataSyncSync()` instead.",
+ );
op_fs_fdatasync_sync(rid);
}
async function fdatasync(rid) {
+ internals.warnOnDeprecatedApi(
+ "Deno.fdatasync()",
+ new Error().stack,
+ "Use `await file.dataSync()` instead.",
+ );
await op_fs_fdatasync_async(rid);
}
@@ -703,6 +713,14 @@ class FsFile {
return fstatSync(this.rid);
}
+ async dataSync() {
+ await op_fs_fdatasync_async(this.rid);
+ }
+
+ dataSyncSync() {
+ op_fs_fdatasync_sync(this.rid);
+ }
+
close() {
core.close(this.rid);
}