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: Correct note on behavior of stats.isDirectory #50946

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

NReilingh
Copy link
Contributor

Original author incorrectly assumed that lstat can only be used on symbolic links

The note incorrectly stated that .isDirectory() always returns false when the stats object was obtained from fs.lstat(). lstat can be used on any type of object -- not just symbolic links. When stats are obtained using lstat for a regular directory (not a link), .isDirectory() will return true.

$ mkdir -p /tmp/foo
const fs = require('fs');
const lstats = await fs.promises.lstat('/tmp/foo');
lstats.isDirectory(); // true

@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 Nov 27, 2023
doc/api/fs.md Outdated Show resolved Hide resolved
@lpinca
Copy link
Member

lpinca commented Dec 15, 2023

Can you please fix the first commit message so that it adheres to our commit message guidelines? Thank you.

@NReilingh NReilingh changed the title doc/api/fs: Correct note on stats.isDirectory doc: Correct note on behavior of stats.isDirectory Dec 17, 2023
@NReilingh
Copy link
Contributor Author

Can you please fix the first commit message so that it adheres to our commit message guidelines? Thank you.

@lpinca Is there a way to do that through GitHub, or does this require force-pushing new commits?

@lpinca
Copy link
Member

lpinca commented Dec 17, 2023

It requires force pushing.

@NReilingh
Copy link
Contributor Author

@lpinca Okay -- unless I've misunderstood the lint, this should be OK now.

@NReilingh
Copy link
Contributor Author

Trying again.

@lpinca lpinca added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Dec 18, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 18, 2023
@nodejs-github-bot nodejs-github-bot merged commit 135948d into nodejs:main Dec 18, 2023
19 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 135948d

RafaelGSS pushed a commit that referenced this pull request Jan 2, 2024
PR-URL: #50946
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Jan 2, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #50946
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@richardlau richardlau mentioned this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

6 participants