diff options
author | rbuj <[email protected]> | 2019-08-10 15:02:12 +0200 |
---|---|---|
committer | monsta <[email protected]> | 2020-02-08 12:00:32 +0300 |
commit | 9f8b8d32b2d55dd3d3cdeed426af259862bf7b47 (patch) | |
tree | d91f96f8249f5301053e86a03acd0743cb3eaac5 | |
parent | 15be27efb9d77834f63cc8e8dc758d1856a96759 (diff) | |
download | caja-9f8b8d32b2d55dd3d3cdeed426af259862bf7b47.tar.bz2 caja-9f8b8d32b2d55dd3d3cdeed426af259862bf7b47.tar.xz |
Copy file and keep timestamps of original file including remotes
The timestamps are reset to the current time, even if the source &
target folders support these GFileInfo attributes.
Closes #1226
-rw-r--r-- | libcaja-private/caja-file-operations.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libcaja-private/caja-file-operations.c b/libcaja-private/caja-file-operations.c index 59d9b728..ab2a7719 100644 --- a/libcaja-private/caja-file-operations.c +++ b/libcaja-private/caja-file-operations.c @@ -3690,7 +3690,7 @@ copy_move_directory (CopyMoveJob *copy_job, if (create_dest) { flags = (readonly_source_fs) ? G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_TARGET_DEFAULT_PERMS - : G_FILE_COPY_NOFOLLOW_SYMLINKS; + : G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_ALL_METADATA; /* Ignore errors here. Failure to copy metadata is not a hard error */ g_file_copy_attributes (src, *dest, flags, @@ -4246,6 +4246,13 @@ copy_move_file (CopyMoveJob *copy_job, } if (res) { + if (!copy_job->is_move) { + /* Ignore errors here. Failure to copy metadata is not a hard error */ + g_file_copy_attributes (src, dest, + flags | G_FILE_COPY_ALL_METADATA, + job->cancellable, NULL); + } + transfer_info->num_files ++; report_copy_progress (copy_job, source_info, transfer_info); |