summaryrefslogtreecommitdiff
path: root/cli/js/ops/fs/stat.ts
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-06-22 20:58:52 +0800
committerGitHub <noreply@github.com>2020-06-22 08:58:52 -0400
commit6b3be01a00d9eaa134a5e58570239d6c1cd3bf54 (patch)
treeefa06fcb35a67a1481fbd6d48c8e2d18cc43381b /cli/js/ops/fs/stat.ts
parent79adc7b000a807caff01a3639b18cb91aef9bd9c (diff)
feat(unstable): add Deno.fstatSync and fstat (#6425)
Diffstat (limited to 'cli/js/ops/fs/stat.ts')
-rw-r--r--cli/js/ops/fs/stat.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/js/ops/fs/stat.ts b/cli/js/ops/fs/stat.ts
index 93d31fc3f..402adeafc 100644
--- a/cli/js/ops/fs/stat.ts
+++ b/cli/js/ops/fs/stat.ts
@@ -66,6 +66,14 @@ export function parseFileInfo(response: StatResponse): FileInfo {
};
}
+export function fstatSync(rid: number): FileInfo {
+ return parseFileInfo(sendSync("op_fstat", { rid }));
+}
+
+export async function fstat(rid: number): Promise<FileInfo> {
+ return parseFileInfo(await sendAsync("op_fstat", { rid }));
+}
+
export async function lstat(path: string | URL): Promise<FileInfo> {
path = pathFromURL(path);
const res = (await sendAsync("op_stat", {