Skip to content
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

doc: improved documentation for fs.unlink() #18843

Closed
wants to merge 5 commits into from
Closed

doc: improved documentation for fs.unlink() #18843

wants to merge 5 commits into from

Conversation

dustinnewman
Copy link
Contributor

Refs: #11135

Checklist
Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Feb 18, 2018
doc/api/fs.md Outdated
@@ -2745,12 +2745,31 @@ changes:
it will emit a deprecation warning.
-->

* `path` {string|Buffer|URL}
* `path` {string|Buffer|URL} File name or file descriptor
Copy link
Member

@Trott Trott Feb 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this really be a file descriptor? Also, "file" is not accurate, is it? This could be a symlink or a directory, couldn't it? I think "path" is probably the best description, so I don't know that this needs a text explanation.

doc/api/fs.md Outdated
});
```

Note that unlink() will not work on a directory, empty or otherwise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unlink() needs backticks around it. Also, probably should be fs.unlink() for maximum clarity?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also recommend dropping Note that from the start of the sentence. Just tell me what I need to know, and that I need to note it. :-D

@Trott
Copy link
Member

Trott commented Feb 18, 2018

Hi, @dustinnewman98! Thanks for the PR and welcome to the project! I left comments, and I'm sure others will too. Please don't get discouraged! Documentation changes tend to generate a lot of comments (and with good reason). Thanks again and I hope you stick with it and get this thing landed!

@dustinnewman
Copy link
Contributor Author

@Trott Thanks for the review! I've addressed the comments.

@Trott
Copy link
Member

Trott commented Feb 18, 2018

@nodejs/documentation @nodejs/fs

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Maybe add a reference to how a directory can be deleted here instead of the negative example?

doc/api/fs.md Outdated
});
```

`fs.unlink()` will not work on a directory, empty or otherwise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @benjamingr and think it would be good to reference the correct function in a new sentence here instead of having the example below.

@dustinnewman
Copy link
Contributor Author

dustinnewman commented Feb 18, 2018

@BridgeAR @benjamingr Thanks for the review! I've added the suggested changes.

doc/api/fs.md Outdated
});
```

`fs.unlink()` will not work on a directory, empty or otherwise. To remove a directory, use `fs.rmdir()`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to actually make this a link. Most functions are already listed but rmdir does not seem to be one of those. So please add the entry at the bottom of the file and write here:

[`fs.rmdir()`][]

doc/api/fs.md Outdated
// err is not null because a directory cannot be deleted through unlink().
});
```

Copy link
Member

@BridgeAR BridgeAR Feb 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we do not need an error example here.

@dustinnewman
Copy link
Contributor Author

@BridgeAR Made suggested changes! :)

doc/api/fs.md Outdated
});
```

`fs.unlink()` will not work on a directory, empty or otherwise. To remove a directory, use [`fs.rmdir()`][].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, please wrap the line at 80 characters.

@dustinnewman
Copy link
Contributor Author

@BridgeAR Wrapped!

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 18, 2018
@BridgeAR
Copy link
Member

@mmarchini
Copy link
Contributor

Landed in e83adf8 😄

@mmarchini mmarchini closed this Feb 20, 2018
mmarchini pushed a commit that referenced this pull request Feb 20, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Feb 21, 2018
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Refs: nodejs#11135

PR-URL: nodejs#18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 7, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 7, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 9, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Aug 16, 2018
MylesBorins pushed a commit that referenced this pull request Aug 16, 2018
Refs: #11135

PR-URL: #18843
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants