1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

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.
This commit is contained in:
Asher Gomez 2024-02-20 00:33:42 +11:00 committed by GitHub
parent 15c64365a2
commit eb542bc185
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -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"],

View file

@ -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) {

View file

@ -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,

View file

@ -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> {