GeezerVison is showing github.com — fs.statSync does not throw an error when accessing non-existent directory on Windows 10 · Issue #9106 · nodejs/node
fs.statSync does not throw an error when accessing non-existent directory on Windows 10 #9106
Labels
fsIssues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform. Description
- Version: v6.7.0
- Platform: Windows 10 (64 bit)
- Subsystem: fs
On Windows 10, I am not getting the same behavior of fs.statSync when trying to access a non-existent directory as I do on Linux. The expected result is for an error to be thrown, which occurs on Linux, but not on Windows 10.
Example:
try {
var stat = fs.statSync(path_to_missing_dir);
if (stat.isDirectory()) return true;
} catch (err) {
console.log(err.message); // not reached on windows 10
} Activity
added
fsIssues and PRs related to file-system APIs and the fs module. windowsIssues and PRs related to the Windows platform. on Oct 15, 2016seishun commented on Oct 15, 2016
Can't reproduce. Can you provide an example of path_to_missing_dir?
balos1 commented on Oct 15, 2016
The path which I was trying to reach when I came across this problem was C:\\Users\\SomeUser\\Projects\\test\\test_sub\\.git\\.
seishun commented on Oct 15, 2016
Are you sure that directory actually doesn't exist and isn't just hidden?
balos1 commented on Oct 15, 2016
Positive it doesn't exist, but I did just try this on another system and can't reproduce... so since I am using nvm-windows to install node, I just upgraded my system to v6.8.0, and the error was properly thrown.
balos1 commented on Oct 15, 2016
OK, reinstalled 6.7.0 on my system and the error is properly thrown now as well. Possibly something was corrupted with my original installation of 6.7.0. Looks like this was a non-issue and can be closed.
Metadata
Metadata
fsIssues and PRs related to file-system APIs and the fs module.windowsIssues and PRs related to the Windows platform. Development
No branches or pull requestsIssue actions