@@ -1687,7 +1687,7 @@ static void RmSync(const FunctionCallbackInfo<Value>& args) {
1687
1687
}
1688
1688
1689
1689
// On Windows path::c_str() returns wide char, convert to std::string first.
1690
- std::string file_path_str = file_path.string ();
1690
+ std::string file_path_str = file_path.native ();
1691
1691
const char * path_c_str = file_path_str.c_str ();
1692
1692
#ifdef _WIN32
1693
1693
int permission_denied_error = EPERM;
@@ -3180,7 +3180,7 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) {
3180
3180
// Check if src and dest are identical.
3181
3181
if (std::filesystem::equivalent (src_path, dest_path)) {
3182
3182
std::string message = " src and dest cannot be the same %s" ;
3183
- return THROW_ERR_FS_CP_EINVAL (env, message.c_str (), dest_path.string ());
3183
+ return THROW_ERR_FS_CP_EINVAL (env, message.c_str (), dest_path.native ());
3184
3184
}
3185
3185
3186
3186
const bool dest_is_dir =
@@ -3190,19 +3190,19 @@ static void CpSyncCheckPaths(const FunctionCallbackInfo<Value>& args) {
3190
3190
std::string message =
3191
3191
" Cannot overwrite non-directory %s with directory %s" ;
3192
3192
return THROW_ERR_FS_CP_DIR_TO_NON_DIR (
3193
- env, message.c_str (), src_path.string (), dest_path.string ());
3193
+ env, message.c_str (), src_path.native (), dest_path.native ());
3194
3194
}
3195
3195
3196
3196
if (!src_is_dir && dest_is_dir) {
3197
3197
std::string message =
3198
3198
" Cannot overwrite directory %s with non-directory %s" ;
3199
3199
return THROW_ERR_FS_CP_NON_DIR_TO_DIR (
3200
- env, message.c_str (), dest_path.string (), src_path.string ());
3200
+ env, message.c_str (), dest_path.native (), src_path.native ());
3201
3201
}
3202
3202
}
3203
3203
3204
- std::string dest_path_str = dest_path.string ();
3205
- std::string src_path_str = src_path.string ();
3204
+ std::string dest_path_str = dest_path.native ();
3205
+ std::string src_path_str = src_path.native ();
3206
3206
if (!src_path_str.ends_with (std::filesystem::path::preferred_separator)) {
3207
3207
src_path_str += std::filesystem::path::preferred_separator;
3208
3208
}
0 commit comments