diff options
author | Casper Beyer <caspervonb@pm.me> | 2021-04-11 20:05:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 14:05:22 +0200 |
commit | f5a9474952f459a5095e0aae68e0984fdd84b210 (patch) | |
tree | 314c1e9e9c5d86e0360b5e21d308d870d009723d /runtime | |
parent | c0b6e09172f242e98a5bc82bd6f5dc20f705c8a2 (diff) |
feat: stabilize Deno.ftruncate and Deno.ftruncateSync (#10126)
This stabilizes Deno.ftruncate and Deno.ftruncateSync.
This is a well known system call and the interface is
not going to change. Implicitly requires write permissions
as the file has to be opened with write to be truncated.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/js/90_deno_ns.js | 4 | ||||
-rw-r--r-- | runtime/ops/fs.rs | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index c240d1ea2..3c13489c7 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -50,6 +50,8 @@ lstat: __bootstrap.fs.lstat, truncateSync: __bootstrap.fs.truncateSync, truncate: __bootstrap.fs.truncate, + ftruncateSync: __bootstrap.fs.ftruncateSync, + ftruncate: __bootstrap.fs.ftruncate, errors: __bootstrap.errors.errors, customInspect: __bootstrap.console.customInspect, inspect: __bootstrap.console.inspect, @@ -124,8 +126,6 @@ startTls: __bootstrap.tls.startTls, fstatSync: __bootstrap.fs.fstatSync, fstat: __bootstrap.fs.fstat, - ftruncateSync: __bootstrap.fs.ftruncateSync, - ftruncate: __bootstrap.fs.ftruncate, umask: __bootstrap.fs.umask, futime: __bootstrap.fs.futime, futimeSync: __bootstrap.fs.futimeSync, diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs index 3d9802b08..a084fdb15 100644 --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -1299,7 +1299,6 @@ fn op_ftruncate_sync( args: FtruncateArgs, _zero_copy: Option<ZeroCopyBuf>, ) -> Result<(), AnyError> { - super::check_unstable(state, "Deno.ftruncate"); let rid = args.rid; let len = args.len as u64; StdFileResource::with(state, rid, |r| match r { @@ -1314,7 +1313,6 @@ async fn op_ftruncate_async( args: FtruncateArgs, _zero_copy: Option<ZeroCopyBuf>, ) -> Result<(), AnyError> { - super::check_unstable2(&state, "Deno.ftruncate"); let rid = args.rid; let len = args.len as u64; |