summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-04-12 19:33:05 +0800
committerGitHub <noreply@github.com>2021-04-12 13:33:05 +0200
commitda9219341fe8bcf080d3ebdd03d35cec1268875e (patch)
tree75f21430ff33cdcbe071caaa7b18e2063cb75538 /runtime/js
parent5c2a8cdbdcc3ae74a4c2d8fb704a331986f49a95 (diff)
feat(runtime): add stat and statSync methods to Deno.File (#10107)
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/30_fs.js4
-rw-r--r--runtime/js/40_files.js (renamed from runtime/js/30_files.js)9
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/js/30_fs.js b/runtime/js/30_fs.js
index e79247640..af2aebd3e 100644
--- a/runtime/js/30_fs.js
+++ b/runtime/js/30_fs.js
@@ -390,8 +390,6 @@
removeSync,
renameSync,
rename,
- fstatSync,
- fstat,
lstat,
lstatSync,
stat,
@@ -403,6 +401,8 @@
umask,
link,
linkSync,
+ fstatSync,
+ fstat,
futime,
futimeSync,
utime,
diff --git a/runtime/js/30_files.js b/runtime/js/40_files.js
index f9898c5d8..2ce495f8e 100644
--- a/runtime/js/30_files.js
+++ b/runtime/js/40_files.js
@@ -4,6 +4,7 @@
((window) => {
const core = window.Deno.core;
const { read, readSync, write, writeSync } = window.__bootstrap.io;
+ const { fstat, fstatSync } = window.__bootstrap.fs;
const { pathFromURL } = window.__bootstrap.util;
function seekSync(
@@ -103,6 +104,14 @@
return seekSync(this.rid, offset, whence);
}
+ stat() {
+ return fstat(this.rid);
+ }
+
+ statSync() {
+ return fstatSync(this.rid);
+ }
+
close() {
core.close(this.rid);
}