mirror of
https://github.com/denoland/deno.git
synced 2025-07-23 21:25:32 +00:00
Improve tests and docs for Deno.rename (#4597)
This commit is contained in:
parent
d8f32c7eff
commit
ce02167c75
2 changed files with 170 additions and 34 deletions
14
cli/js/lib.deno.ns.d.ts
vendored
14
cli/js/lib.deno.ns.d.ts
vendored
|
@ -1284,8 +1284,10 @@ declare namespace Deno {
|
|||
*
|
||||
* Deno.renameSync("old/path", "new/path");
|
||||
*
|
||||
* Throws error if attempting to rename to a directory which exists and is not
|
||||
* empty.
|
||||
* On Unix, this operation does not follow symlinks at either path.
|
||||
*
|
||||
* It varies between platforms when the operation throws errors, and if so what
|
||||
* they are. It's always an error to rename anything to a non-empty directory.
|
||||
*
|
||||
* Requires `allow-read` and `allow-write` permissions. */
|
||||
export function renameSync(oldpath: string, newpath: string): void;
|
||||
|
@ -1297,10 +1299,12 @@ declare namespace Deno {
|
|||
*
|
||||
* await Deno.rename("old/path", "new/path");
|
||||
*
|
||||
* Throws error if attempting to rename to a directory which exists and is not
|
||||
* empty.
|
||||
* On Unix, this operation does not follow symlinks at either path.
|
||||
*
|
||||
* Requires `allow-read` and `allow-write`. */
|
||||
* It varies between platforms when the operation throws errors, and if so what
|
||||
* they are. It's always an error to rename anything to a non-empty directory.
|
||||
*
|
||||
* Requires `allow-read` and `allow-write` permission. */
|
||||
export function rename(oldpath: string, newpath: string): Promise<void>;
|
||||
|
||||
/** Synchronously reads and returns the entire contents of a file as an array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue