summaryrefslogtreecommitdiff
path: root/ext/fs
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-09-04 18:53:43 +1000
committerGitHub <noreply@github.com>2024-09-04 08:53:43 +0000
commit3d36cbd056292e0a89d282fa84b7198ae38be4cc (patch)
tree11d0b88b68fe104958584b9c4abf7f80bbd3e3a6 /ext/fs
parentac33fc2892f8faf9484c31c2aabfdc3744de0314 (diff)
BREAKING(fs): remove `Deno.ftruncate[Sync]()` (#25412)
Towards #22079 Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Diffstat (limited to 'ext/fs')
-rw-r--r--ext/fs/30_fs.js16
-rw-r--r--ext/fs/lib.rs2
-rw-r--r--ext/fs/ops.rs2
3 files changed, 5 insertions, 15 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index 87607ca28..35bf0e712 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -19,11 +19,11 @@ import {
op_fs_fdatasync_sync,
op_fs_file_stat_async,
op_fs_file_stat_sync,
+ op_fs_file_truncate_async,
op_fs_flock_async,
op_fs_flock_sync,
op_fs_fsync_async,
op_fs_fsync_sync,
- op_fs_ftruncate_async,
op_fs_ftruncate_sync,
op_fs_funlock_async,
op_fs_funlock_async_unstable,
@@ -422,14 +422,6 @@ function coerceLen(len) {
return len;
}
-function ftruncateSync(rid, len) {
- op_fs_ftruncate_sync(rid, coerceLen(len));
-}
-
-async function ftruncate(rid, len) {
- await op_fs_ftruncate_async(rid, coerceLen(len));
-}
-
function truncateSync(path, len) {
op_fs_truncate_sync(path, coerceLen(len));
}
@@ -655,11 +647,11 @@ class FsFile {
}
truncate(len) {
- return ftruncate(this.#rid, len);
+ return op_fs_file_truncate_async(this.#rid, coerceLen(len));
}
truncateSync(len) {
- return ftruncateSync(this.#rid, len);
+ return op_fs_ftruncate_sync(this.#rid, coerceLen(len));
}
read(p) {
@@ -962,8 +954,6 @@ export {
FsFile,
fsync,
fsyncSync,
- ftruncate,
- ftruncateSync,
funlock,
funlockSync,
link,
diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs
index be43c81d9..7cf5f6cb3 100644
--- a/ext/fs/lib.rs
+++ b/ext/fs/lib.rs
@@ -242,7 +242,7 @@ deno_core::extension!(deno_fs,
op_fs_funlock_async,
op_fs_funlock_sync,
op_fs_ftruncate_sync,
- op_fs_ftruncate_async,
+ op_fs_file_truncate_async,
op_fs_futime_sync,
op_fs_futime_async,
diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs
index 7d28b56b0..acf2c216f 100644
--- a/ext/fs/ops.rs
+++ b/ext/fs/ops.rs
@@ -1569,7 +1569,7 @@ pub fn op_fs_ftruncate_sync(
}
#[op2(async)]
-pub async fn op_fs_ftruncate_async(
+pub async fn op_fs_file_truncate_async(
state: Rc<RefCell<OpState>>,
#[smi] rid: ResourceId,
#[number] len: u64,