mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
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:
parent
cdae4423c2
commit
aa47f8186c
5 changed files with 27 additions and 29 deletions
21
cli/dts/lib.deno.ns.d.ts
vendored
21
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue