From aa47f8186cbc068232e23b92a6966be9bd23e4bb Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Fri, 26 Feb 2021 01:35:10 +0800 Subject: feat(runtime): stabilize Deno.link and Deno.linkSync (#9417) This commit makes "Deno.link" and "Deno.linkSync" stable. The permission required has been changed to read-write to ensure one cannot escape the sandbox. --- cli/dts/lib.deno.ns.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cli/dts/lib.deno.ns.d.ts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 15088934a..aa10ce3af 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -265,6 +265,27 @@ declare namespace Deno { */ export function cwd(): string; + /** + * Synchronously creates `newpath` as a hard link to `oldpath`. + * + * ```ts + * Deno.linkSync("old/name", "new/name"); + * ``` + * + * Requires `allow-read` and `allow-write` permissions. */ + export function linkSync(oldpath: string, newpath: string): void; + + /** + * + * Creates `newpath` as a hard link to `oldpath`. + * + * ```ts + * await Deno.link("old/name", "new/name"); + * ``` + * + * Requires `allow-read` and `allow-write` permissions. */ + export function link(oldpath: string, newpath: string): Promise; + export enum SeekMode { Start = 0, Current = 1, -- cgit v1.2.3