Skip to content

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

@NReilingh

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
constfs=require('fs');constlstats=awaitfs.promises.lstat('/tmp/foo');lstats.isDirectory();// true

@nodejs-github-botnodejs-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 threaddoc/api/fs.md Outdated
@lpinca

Copy link
Copy Markdown
Member

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

@NReilinghNReilingh changed the title doc/api/fs: Correct note on stats.isDirectorydoc: Correct note on behavior of stats.isDirectoryDec 17, 2023
@NReilingh

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
Member

It requires force pushing.

@NReilingh

Copy link
Copy Markdown
ContributorAuthor

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

@NReilingh

Copy link
Copy Markdown
ContributorAuthor

Trying again.

@lpincalpinca 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-botnodejs-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:mainDec 18, 2023
@nodejs-github-bot

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>
@RafaelGSSRafaelGSS 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>
@richardlaurichardlau mentioned this pull request Mar 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@NReilingh@lpinca@nodejs-github-bot@jasnell@watilde@aymen94