Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: fix fs.promises.realpath for long paths on Windows #51032

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ async function realpath(path, options) {
options = getOptions(options);
path = getValidatedPath(path);
return await PromisePrototypeThen(
binding.realpath(path, options.encoding, kUsePromises),
binding.realpath(pathModule.toNamespacedPath(path), options.encoding, kUsePromises),
undefined,
handleErrorFromBinding,
);
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-fs-long-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ fs.writeFile(fullPath, 'ok', common.mustSucceed(() => {

// Tests https://github.com/nodejs/node/issues/39721
fs.realpath.native(fullPath, common.mustSucceed());

// Tests https://github.com/nodejs/node/issues/51031
fs.promises.realpath(fullPath).then(common.mustCall(), common.mustNotCall());
}));