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.
This commit is contained in:
Casper Beyer 2021-02-26 01:35:10 +08:00 committed by GitHub
parent cdae4423c2
commit aa47f8186c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 29 deletions

View file

@ -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<void>;
export enum SeekMode {
Start = 0,
Current = 1,