Repository navigation
statSync fails in detecting link #47633
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Description
Activity
fs.statfollows symlinks. You need to calllstatif you don't want this behaviorReacted by Benjamin Gruenbaum and Darshan Sen- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
on Apr 20, 2023 Hi,
yes you are right I missed it in the doc.
Maybe it is possible to explicitly write this in the documentation of allstat()function variants (stat,promises.stat(), etc.), so it will be clearer? (I suppose the "doc" tag of this issue means exactly this :) )Regards
I think it would be helpful to mention it directly in the documentation, yes.
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Apr 20, 2023 hey @targos , i would like to work on it if its open, can i git this assigned :)
@targos I tried to make an edit
- added a commit that references this issue
on Apr 23, 2023 - added a commit that references this issue
on May 2, 2023 - added a commit that references this issue
on Jul 6, 2023 - added a commit that references this issue
on Jul 6, 2023
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Version
v18.15.0
Platform
Linux debian 6.1.0-7-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.20-2 (2023-04-08) x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Just call
statSync()onnode_modules/.bin/mocha:Result:
File: true, Link: falseBut if I run in
bash:Result:
So it is truly a symbolic link.
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
it should say that it is a link and not a regular file
What do you see instead?
It says it is a regular file
Additional information
No response