diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-02-20 00:33:42 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 06:33:42 -0700 |
commit | eb542bc185c6c4ce1847417a2dfdf04862cd86db (patch) | |
tree | 34a5ef4be50d28765677843c70af1000ad58f2af | |
parent | 15c64365a258e6498fa04c34c75813e9486397c2 (diff) |
chore(fs): rename `op_fs_file_stat_{async/sync}` ops (#22476)
Renames `op_fs_fstat_{sync/async}` to `op_fs_file_stat_{async/sync}` in
preparation of the upcoming removal of `Deno.fstat()` in v2.
-rw-r--r-- | cli/tools/test/fmt.rs | 2 | ||||
-rw-r--r-- | ext/fs/30_fs.js | 8 | ||||
-rw-r--r-- | ext/fs/lib.rs | 4 | ||||
-rw-r--r-- | ext/fs/ops.rs | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/cli/tools/test/fmt.rs b/cli/tools/test/fmt.rs index a185bd04f..fa2362ea1 100644 --- a/cli/tools/test/fmt.rs +++ b/cli/tools/test/fmt.rs @@ -278,7 +278,7 @@ pub const OP_DETAILS: phf::Map<&'static str, [&'static str; 2]> = phf_map! { "op_ffi_call_ptr_nonblocking" => ["do a non blocking ffi call", "awaiting the returned promise"], "op_flock_async" => ["lock a file", "awaiting the result of a `Deno.flock` call"], "op_fs_events_poll" => ["get the next file system event", "breaking out of a for await loop looping over `Deno.FsEvents`"], - "op_fstat_async" => ["get file metadata", "awaiting the result of a `Deno.File#fstat` call"], + "op_fs_file_stat_async" => ["get file metadata", "awaiting the result of a `Deno.FsFile#stat` call"], "op_fsync_async" => ["flush pending data operations for a file to disk", "awaiting the result of a `file.fsync` call"], "op_ftruncate_async" => ["truncate a file", "awaiting the result of a `Deno.ftruncate` call"], "op_funlock_async" => ["unlock a file", "awaiting the result of a `Deno.funlock` call"], diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index 2efb0a878..3858bba26 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -19,10 +19,10 @@ import { op_fs_fdatasync_async_unstable, op_fs_fdatasync_sync, op_fs_fdatasync_sync_unstable, + op_fs_file_stat_async, + op_fs_file_stat_sync, op_fs_flock_async, op_fs_flock_sync, - op_fs_fstat_async, - op_fs_fstat_sync, op_fs_fsync_async, op_fs_fsync_async_unstable, op_fs_fsync_sync, @@ -398,12 +398,12 @@ function parseFileInfo(response) { } function fstatSync(rid) { - op_fs_fstat_sync(rid, statBuf); + op_fs_file_stat_sync(rid, statBuf); return statStruct(statBuf); } async function fstat(rid) { - return parseFileInfo(await op_fs_fstat_async(rid)); + return parseFileInfo(await op_fs_file_stat_async(rid)); } async function lstat(path) { diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs index 0bf5462f8..c31cdd85d 100644 --- a/ext/fs/lib.rs +++ b/ext/fs/lib.rs @@ -136,8 +136,8 @@ deno_core::extension!(deno_fs, op_fs_fsync_async, op_fs_fsync_sync_unstable, op_fs_fsync_async_unstable, - op_fs_fstat_sync, - op_fs_fstat_async, + op_fs_file_stat_sync, + op_fs_file_stat_async, op_fs_flock_sync, op_fs_flock_async, op_fs_funlock_sync, diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index e8573229b..bc9f75a3c 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -1424,7 +1424,7 @@ pub async fn op_fs_fsync_async_unstable( } #[op2(fast)] -pub fn op_fs_fstat_sync( +pub fn op_fs_file_stat_sync( state: &mut OpState, #[smi] rid: ResourceId, #[buffer] stat_out_buf: &mut [u32], @@ -1438,7 +1438,7 @@ pub fn op_fs_fstat_sync( #[op2(async)] #[serde] -pub async fn op_fs_fstat_async( +pub async fn op_fs_file_stat_async( state: Rc<RefCell<OpState>>, #[smi] rid: ResourceId, ) -> Result<SerializableStat, AnyError> { |