diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index 4e456b444b..94af49b873 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -37,8 +37,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "connect", "consoleSize", "createHttpClient", - "futime", - "futimeSync", "kill", "listen", "listenDatagram", diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index ed6e8ad4f1..86be40c67b 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -3962,6 +3962,42 @@ declare namespace Deno { */ export function ftruncate(rid: number, len?: number): Promise; + /** + * Synchronously changes the access (`atime`) and modification (`mtime`) times + * of a file stream resource referenced by `rid`. Given times are either in + * seconds (UNIX epoch time) or as `Date` objects. + * + * ```ts + * const file = Deno.openSync("file.txt", { create: true, write: true }); + * Deno.futimeSync(file.rid, 1556495550, new Date()); + * ``` + * + * @category File System + */ + export function futimeSync( + rid: number, + atime: number | Date, + mtime: number | Date, + ): void; + + /** + * Changes the access (`atime`) and modification (`mtime`) times of a file + * stream resource referenced by `rid`. Given times are either in seconds + * (UNIX epoch time) or as `Date` objects. + * + * ```ts + * const file = await Deno.open("file.txt", { create: true, write: true }); + * await Deno.futime(file.rid, 1556495550, new Date()); + * ``` + * + * @category File System + */ + export function futime( + rid: number, + atime: number | Date, + mtime: number | Date, + ): Promise; + /** * Synchronously returns a `Deno.FileInfo` for the given file stream. * diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 1085c70395..1b26cdd334 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -980,48 +980,6 @@ declare namespace Deno { options: CreateHttpClientOptions, ): HttpClient; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Synchronously changes the access (`atime`) and modification (`mtime`) times - * of a file stream resource referenced by `rid`. Given times are either in - * seconds (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = Deno.openSync("file.txt", { create: true, write: true }); - * Deno.futimeSync(file.rid, 1556495550, new Date()); - * ``` - * - * Needs investigation into high precision time. - * - * @category File System - */ - export function futimeSync( - rid: number, - atime: number | Date, - mtime: number | Date, - ): void; - - /** **UNSTABLE**: New API, yet to be vetted. - * - * Changes the access (`atime`) and modification (`mtime`) times of a file - * stream resource referenced by `rid`. Given times are either in seconds - * (UNIX epoch time) or as `Date` objects. - * - * ```ts - * const file = await Deno.open("file.txt", { create: true, write: true }); - * await Deno.futime(file.rid, 1556495550, new Date()); - * ``` - * - * Needs investigation into high precision time. - * - * @category File System - */ - export function futime( - rid: number, - atime: number | Date, - mtime: number | Date, - ): Promise; - /** **UNSTABLE**: New API, yet to be vetted. * * A generic transport listener for message-oriented protocols. diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index b4440d2acd..b9e361ae4d 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -55,6 +55,8 @@ truncate: __bootstrap.fs.truncate, ftruncateSync: __bootstrap.fs.ftruncateSync, ftruncate: __bootstrap.fs.ftruncate, + futime: __bootstrap.fs.futime, + futimeSync: __bootstrap.fs.futimeSync, errors: __bootstrap.errors.errors, // TODO(kt3k): Remove this export at v2 // See https://github.com/denoland/deno/issues/9294 @@ -128,8 +130,6 @@ getUid: __bootstrap.os.getUid, listenDatagram: __bootstrap.net.listenDatagram, umask: __bootstrap.fs.umask, - futime: __bootstrap.fs.futime, - futimeSync: __bootstrap.fs.futimeSync, utime: __bootstrap.fs.utime, utimeSync: __bootstrap.fs.utimeSync, HttpClient: __bootstrap.fetch.HttpClient, diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs index 9b0737fe95..f2ee9af9e9 100644 --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -1916,7 +1916,6 @@ fn op_futime_sync( mtime_secs: i64, mtime_nanos: u32, ) -> Result<(), AnyError> { - super::check_unstable(state, "Deno.futimeSync"); let atime = filetime::FileTime::from_unix_time(atime_secs, atime_nanos); let mtime = filetime::FileTime::from_unix_time(mtime_secs, mtime_nanos); @@ -1937,7 +1936,6 @@ async fn op_futime_async( mtime_secs: i64, mtime_nanos: u32, ) -> Result<(), AnyError> { - super::check_unstable2(&state, "Deno.futime"); let atime = filetime::FileTime::from_unix_time(atime_secs, atime_nanos); let mtime = filetime::FileTime::from_unix_time(mtime_secs, mtime_nanos);