fs.existSync returns true after fs. symlinkSync node 10 onwards in windows only #30538
Copy link
Copy link
Closed
Closed
Copy link
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Activity
It seems reasonable at Linux, because the link is broken (There is no
test/foo.jsfile)If
test/foo.jsexists the second result would betrue.The behavior of Windows seems caused by using
accessinstead ofstatto implementexistsSync, See #18618Maybe we should firstly add some tests to
test-fs-exists.jsto cover this case@pd4d10 Thanks for the response. Should I consider this issue as a bug in the windows?
Perhaps
existsshould just check bothaccessandstaton Windows...- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Nov 19, 2019 - added a commit that references this issue
on Dec 9, 2019 - added a commit that references this issue
on Jan 13, 2020 - added a commit that references this issue
on Feb 6, 2020
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Hi,
I started seeing a difference in behavior when I run the following code in Linux and Windows in node 10 and node 12.
I created reproduction repo and
travis,appveyorCI to show the difference.Please check the output of the above snippet;
I am not sure why are we getting different result for same code in windows and Linux? Is it a bug or am I missing something.
Reproduction repo: https://github.com/SparshithNR/node-symlink
Travis build: https://travis-ci.com/SparshithNR/node-symlink/builds/137133722
appveyor build: https://ci.appveyor.com/project/SparshithNR/node-symlink
Thank you in advance :)