Synchronize directories fails to copy timestamps to symbolic links

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Synchronize directories fails to copy timestamps to symbolic links

Post by *DrShark »

To reporoduce:
1. Create the NTFS symlink to some file in opposite panel so it will not preserve the date and time of original file, e.g. use TC bar button with NTFSLinkMaker tool which (unfortunately) is not able preserve the timestamp of the source:

Code: Select all

TOTALCMD#BAR#DATA
c:\totalcmd\Utils\NTLinksMaker\NTLinksMaker.exe
/q- /b /r="%P" "@%WL" "%T"
c:\totalcmd\Utils\NTLinksMaker\NTLinksMaker.exe
NTLinksMaker
c:\totalcmd\Utils\NTLinksMaker\
0
-1
In NT Links Maker options, choose "3. Symbolic links only" as the link type.
Confirm elevation request, and symbolic link will be created, but it will have current computer's timestamp.

2. Open Total Commander's Commands->Synchronize Dirs...,
in the Synchronize directories mark "=" direction and press "Compare".

3. Select the line with the file of link source and link itself.
Call context menu, there choose "Copy file properties [...]" item which direction will copy attributes from original file to its link.
In the dialog which will appear, check the "Timestamp (date+time)" checkbox and press OK.
Result: Total Commander won't show errors, but the date of link also won't change.

It is expected that the date and time should change because copying the timestamp of the source file to its symlink works fine using Change Attributes dialog (put cursor on source file and leave it in inactive panel, switch to opposite panel and there put the focus cursor on the symlink, now open File->Change Attributes, there click on "From target (2)" (this should also auto check "Change date/time:" checkbox), click OK, result: the link will actually get the timestamp of original file).
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Synchronize directories fails to copy timestamps to symbolic links

Post by *gdpr deleted 6 »

I can confirm that the timestamps of the link don't change.
I can add the observation that the timestamp of the link target will be changed instead of the timestamp of the file.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize directories fails to copy timestamps to symbolic links

Post by *petermad »

I experience that the date of a symlink file stays untouched after it is created. If I for example edit the original file, only the date on the original file changes. If I edit the symlink file, then the date of the original file changes, but not the symlink file.

But otherwise I can confirm the observation that the Synchronize Tool cannot change the timestamp, but that the Change Attribute Tool can.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Synchronize directories fails to copy timestamps to symbolic links

Post by *DrShark »

history1000.txt wrote:17.03.21 Fixed: Synchronize dirs, Copy file properties: Could not copy timestamp to symbolic link, instead it was copied to the target of the link (32/64)
I can confirm Sync tool now copies the timestamp to symlink properly. But what's strange is, if the comparison before actual timestamp sync start happened with option "by content" enabled, for items in Sync window list for which the timestamp copy operation successfully applied, their filter symbol in status column changes from to (even if in Sync tool I have set active the option "Ignore date"!).
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Synchronize directories fails to copy timestamps to symbolic links

Post by *ghisler(Author) »

That's because the link reports a size of 0, so TC doesn't compare by content.
Author of Total Commander
https://www.ghisler.com
Post Reply