| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a3babb commit 63321ee
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3680,6 +3680,12 @@ std::vector<std::string> normalizePathToArray( | |||
| 3680 | 3680 | const std::filesystem::path& path) { | |
| 3681 | 3681 | std::vector<std::string> parts; | |
| 3682 | 3682 | std::filesystem::path absPath = std::filesystem::absolute(path); | |
| 3683 | + #ifdef _WIN32 | ||
| 3684 | + auto wstr = absPath.wstring(); | ||
| 3685 | + if (wstr.starts_with(L"\\\\?\\")) { | ||
| 3686 | + absPath = std::filesystem::path(wstr.substr(4)); | ||
| 3687 | + } | ||
| 3688 | + #endif | ||
| 3683 | 3689 | for (const auto& part : absPath) { | |
| 3684 | 3690 | if (!part.empty()) parts.push_back(part.string()); | |
| 3685 | 3691 | } | |
@@ -3818,6 +3824,12 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) { | |||
| 3818 | 3824 | } | |
| 3819 | 3825 | auto symlink_target_absolute = std::filesystem::weakly_canonical( | |
| 3820 | 3826 | std::filesystem::absolute(src / symlink_target)); | |
| 3827 | + #ifdef _WIN32 | ||
| 3828 | + auto wstr = symlink_target_absolute.wstring(); | ||
| 3829 | + if (wstr.starts_with(L"\\\\?\\")) { | ||
| 3830 | + symlink_target_absolute = std::filesystem::path(wstr.substr(4)); | ||
| 3831 | + } | ||
| 3832 | + #endif | ||
| 3821 | 3833 | if (dir_entry.is_directory()) { | |
| 3822 | 3834 | std::filesystem::create_directory_symlink( | |
| 3823 | 3835 | symlink_target_absolute, dest_file_path, error); | |
@@ -3841,7 +3853,7 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) { | |||
| 3841 | 3853 | std::filesystem::copy_file( | |
| 3842 | 3854 | dir_entry.path(), dest_file_path, file_copy_opts, error); | |
| 3843 | 3855 | if (error) { | |
| 3844 | - if (error.value() == EEXIST) { | ||
| 3856 | + if (error == std::errc::file_exists) { | ||
| 3845 | 3857 | THROW_ERR_FS_CP_EEXIST(isolate, | |
| 3846 | 3858 | "[ERR_FS_CP_EEXIST]: Target already exists: " | |
| 3847 | 3859 | "cp returned EEXIST (%s already exists)", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,10 +26,8 @@ test-snapshot-reproducible: SKIP | |||
| 26 | 26 | # https://github.com/nodejs/node/issues/59090 | |
| 27 | 27 | test-inspector-network-fetch: PASS, FLAKY | |
| 28 | 28 | # https://github.com/nodejs/node/issues/59636 | |
| 29 | - test-fs-cp-sync-error-on-exist: SKIP | ||
| 30 | 29 | test-fs-cp-sync-symlink-points-to-dest-error: SKIP | |
| 31 | 30 | test-fs-cp-async-symlink-points-to-dest: SKIP | |
| 32 | - test-fs-cp-sync-unicode-folder-names: SKIP | ||
| 33 | 31 | ||
| 34 | 32 | # Windows on ARM | |
| 35 | 33 | [$system==win32 && $arch==arm64] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments