@@ -3588,11 +3588,11 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
3588
3588
if (preserve_timestamps) {
3589
3589
uv_fs_t req;
3590
3590
auto cleanup = OnScopeLeave ([&req]() { uv_fs_req_cleanup (&req); });
3591
- const char * dir_path = dir_entry.path ().c_str ();
3592
3591
3593
- int result = uv_fs_stat (nullptr , &req, dir_path, nullptr );
3592
+ auto dir_entry_path = PathToString (dir_entry.path ());
3593
+ int result = uv_fs_stat (nullptr , &req, dir_entry_path.c_str (), nullptr );
3594
3594
if (is_uv_error (result)) {
3595
- env->ThrowUVException (result, " stat" , nullptr , dir_path );
3595
+ env->ThrowUVException (result, " stat" , nullptr , dir_entry_path. c_str () );
3596
3596
return false ;
3597
3597
}
3598
3598
@@ -3602,11 +3602,11 @@ static void CpSyncCopyDir(const FunctionCallbackInfo<Value>& args) {
3602
3602
const double source_mtime =
3603
3603
s->st_mtim .tv_sec + s->st_mtim .tv_nsec / 1e9 ;
3604
3604
3605
- const char * path = dest_entry_path. c_str ( );
3605
+ auto path = PathToString (dir_entry. path () );
3606
3606
int utime_result = uv_fs_utime (
3607
- nullptr , &req, path, source_atime, source_mtime, nullptr );
3607
+ nullptr , &req, path. c_str () , source_atime, source_mtime, nullptr );
3608
3608
if (is_uv_error (utime_result)) {
3609
- env->ThrowUVException (utime_result, " utime" , nullptr , path);
3609
+ env->ThrowUVException (utime_result, " utime" , nullptr , path. c_str () );
3610
3610
return false ;
3611
3611
}
3612
3612
}
0 commit comments