-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Description
Version
v14.17.3
Platform
Microsoft Windows NT 10.0.18363.0 x64
Subsystem
No response
What steps will reproduce the bug?
Run the following script:
const fs = require("fs");
var path = ".";
for (var i = 0; i < 40; ++i) {
path += "\\foobar";
fs.mkdirSync(path);
}
console.log("These two work and yield a valid result:");
console.log(fs.realpathSync(path));
fs.realpath(path, function(err, res) { console.log(err, res); });
console.log("But this one throws ENOENT:");
async function repro() {
const res = await fs.promises.realpath(path);
console.log(res);
}
repro();
As described in the code, the first two examples will work correctly, printing the expected results, but the third one (repro
) will throw.
How often does it reproduce? Is there a required condition?
It seems to always work, but only on Windows.
What is the expected behavior?
The promise-based variant of realpath
should correctly resolve the path, in the same way as the synchronous and callback-based ones.
What do you see instead?
(node:3084) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, realpath '.\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar\foobar'
Additional information
No response
spazmodius and mwu-tow
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.