-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
doc: Change doc on fs.rename api w.r.t to windows behaviour #22014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2697,10 +2697,19 @@ changes: | |
| * `callback` {Function} | ||
| * `err` {Error} | ||
|
|
||
| Asynchronously rename file at `oldPath` to the pathname provided | ||
| Asynchronously rename file or directory at `oldPath` to the pathname provided | ||
| as `newPath`. In the case that `newPath` already exists, it will | ||
| be overwritten. No arguments other than a possible exception are | ||
| given to the completion callback. | ||
| be overwritten. `fs.rename` can throw the below error: | ||
|
|
||
| - On **Linux** when renaming directory exists and is NOT empty, it throws a | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its not clear or grammatical, call it after the name of the arg: "if |
||
| `ENOTEMPTY` error. | ||
| - On **Unix** when renaming directory exists and is NOT empty, it throws a | ||
| `ENOENT` error. | ||
| - On **Windows** regardless of renaming directory is empty, it throws a | ||
| `EPERM` error. | ||
|
|
||
| No arguments other than a possible exception (as mentioned above) are given to | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just repeats line 2698 in a more complex written form, and it adds confusion. It says an exception is given to the completion callback, but it is an error that is given. Also, more errors than the few documented can occur, and the sentence reads to me as saying that only the errors documented above can be passed. Better, I think, to remove the sentence. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sam-github Make sense. |
||
| the completion callback. | ||
|
|
||
| See also: rename(2). | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the deletion of the last sentence intended?