Skip to content

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
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
@lpinca
Copy link
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
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
Member

It requires force pushing.

@NReilingh
Copy link
ContributorAuthor

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

@NReilingh
Copy link
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-botnodejs-github-bot merged commit 135948d into nodejs:mainDec 18, 2023
@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 <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]>
@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 <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]>
@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