Skip to content

fs: fix cp symlink and EEXIST handling on Windows#64353

Open
PickBas wants to merge 1 commit into
nodejs:mainfrom
JaneaSystems:issue-59636
Open

fs: fix cp symlink and EEXIST handling on Windows#64353
PickBas wants to merge 1 commit into
nodejs:mainfrom
JaneaSystems:issue-59636

Conversation

@PickBas

@PickBas PickBas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

fs: fix cp symlink and EEXIST handling on Windows

On Windows, fs.cp/fs.cpSync had two bugs:

  • Paths from std::filesystem carried the \\?\ extended-length prefix, breaking path comparison and symlink targets. Now stripped.
  • The EEXIST check used the raw POSIX value, which never matched on Windows. Now compares against std::errc::file_exists.

Re-enables 2 tests that were skipped for this issue.

Fixes: #59636

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jul 8, 2026
Fixes: nodejs#59636
Signed-off-by: Kirill Saied <sayed.kirill@gmail.com>
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.24%. Comparing base (e6a8d06) to head (33b9810).
⚠️ Report is 287 commits behind head on main.

Files with missing lines Patch % Lines
src/node_file.cc 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64353      +/-   ##
==========================================
- Coverage   92.01%   90.24%   -1.77%     
==========================================
  Files         379      741     +362     
  Lines      166972   240984   +74012     
  Branches    25554    45398   +19844     
==========================================
+ Hits       153639   217476   +63837     
- Misses      13041    15069    +2028     
- Partials      292     8439    +8147     
Files with missing lines Coverage Δ
src/node_file.cc 74.15% <0.00%> (ø)

... and 545 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some fs.cp* tests are constantly failing on Windows

2 participants