Skip to content

Commit a70aa64

Browse files
authored
Merge pull request #1059 from birdie-github/patch-1
Preserve timestamps for existing destination directories
2 parents 61ab590 + 8cdeacd commit a70aa64

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

far/changelog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
--------------------------------------------------------------------------------
2+
birdie-github 2026-01-31 16:27:32+00:00 - build 6640
3+
4+
1. gh-1059: Preserve timestamps for existing destination directories.
5+
16
--------------------------------------------------------------------------------
27
drkns 2026-01-30 20:00:26+00:00 - build 6639
38

far/copy.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,15 @@ COPY_CODES ShellCopy::ShellCopyOneFile(
19821982
{
19831983
if ((DestAttr & FILE_ATTRIBUTE_DIRECTORY) && !SameName)
19841984
{
1985+
// The destination directory already exists.
1986+
// When "Preserve all timestamps" is enabled we still want to restore
1987+
// the source directory timestamps after the copy is finished.
1988+
//
1989+
// Setting timestamps here would be pointless: the subsequent copy of
1990+
// files into the directory will update its times again.
1991+
if (Global->Opt->CMOpt.PreserveTimestamps)
1992+
m_CreatedFolders.emplace_back(strDestPath, SrcData);
1993+
19851994
auto SetAttr = SrcData.Attributes;
19861995

19871996
if (SrcDriveType == DRIVE_CDROM && (SetAttr & FILE_ATTRIBUTE_READONLY))

far/vbuild.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6639
1+
6640

0 commit comments

Comments
 (0)