FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: Correct note on behavior of stats.isDirectory by NReilingh · Pull Request #50946 · nodejs/node · GitHub

/ node Public

doc: Correct note on behavior of stats.isDirectory - #50946

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
NReilingh:patch-1
Dec 18, 2023
Merged

doc: Correct note on behavior of stats.isDirectory#50946
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
NReilingh:patch-1

Conversation

Copy link
Copy Markdown
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 added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Nov 27, 2023
Comment thread doc/api/fs.md Outdated

lpinca commented Dec 15, 2023

Copy link
Copy Markdown
Member

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

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

Copy link
Copy Markdown
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 commented Dec 17, 2023

Copy link
Copy Markdown
Member

It requires force pushing.

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

Trying again.

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 removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 18, 2023
nodejs-github-bot merged commit 135948d into nodejs:main Dec 18, 2023

Copy link
Copy Markdown
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 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 mentioned this pull request Mar 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL