Skip to content

Commit

Permalink
chore(fs): rename op_fs_file_stat_{async/sync} ops (#22476)
Browse files Browse the repository at this point in the history
Renames `op_fs_fstat_{sync/async}` to `op_fs_file_stat_{async/sync}` in
preparation of the upcoming removal of `Deno.fstat()` in v2.
  • Loading branch information
iuioiua authored Feb 19, 2024
1 parent 15c6436 commit eb542bc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cli/tools/test/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
8 changes: 4 additions & 4 deletions ext/fs/30_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions ext/fs/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions ext/fs/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand All @@ -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> {
Expand Down

0 comments on commit eb542bc

Please sign in to comment.