Option "Copy date/time from directories" does not work correctly

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
beaker
Junior Member
Junior Member
Posts: 3
Joined: 2021-02-13, 23:38 UTC

Option "Copy date/time from directories" does not work correctly

Post by *beaker »

Hi there
When copying a folder structure I received the following message in TC9.51:
"The target name length (260) is more than 259 characters!
Most programs will not be able to access a file/directory with such a long name!
Buttons: Keep name, Keep all, Abort, Skip, Skip all, Rename"

If I now continue with "Keep name" the copy process is completely finished as expected.
But the option "Copy date/time from directories" does not work anymore.
Suddenly the current date is used not the original date!
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Option "Copy date/time from directories" does not work correctly

Post by *sqa_wizard »

Sorry, cannot reproduce.
Original date of files, folder and subfolder is kept with both TC9.51 32-bit and 64-bit copying files to local folder with 300 characters length.
#5767 Personal license
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Option "Copy date/time from directories" does not work correctly

Post by *Usher »

2beaker
What is the target file system? Do you copy files to some pendrive, SD card or other media with FAT32?
Andrzej P. Wozniak
Polish subforum moderator
User avatar
beaker
Junior Member
Junior Member
Posts: 3
Joined: 2021-02-13, 23:38 UTC

Re: Option "Copy date/time from directories" does not work correctly

Post by *beaker »

Okay sorry it is not as simple as I thought.
I am using TC9.51 64-bit
I copy from NTFS -> NTFS

I did not know that it makes a difference how long I wait until I press the button "Keep name"

Good case. (I pressed the "Keep name" Butten immediately):

Code: Select all

15.02.2021 10:00:32: NewFolder: l:\A23456789012345678901234567890123
15.02.2021 10:00:32: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789
15.02.2021 10:00:32: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234
15.02.2021 10:00:32: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456
15.02.2021 10:00:32: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456
15.02.2021 10:00:33: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\F2345678901234567890.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\F2345678901234567890.txt
15.02.2021 10:00:34: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\G2345678901234567890.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\G2345678901234567890.txt
15.02.2021 10:00:34: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\H1234567890123.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\H1234567890123.txt
Bad case. After copying, the date of the "E23456" directory is incorrectly the current date. (I pressed the button "Keep name" after 1 minute):

Code: Select all

15.02.2021 10:01:04: NewFolder: l:\A23456789012345678901234567890123
15.02.2021 10:01:04: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789
15.02.2021 10:01:04: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234
15.02.2021 10:01:04: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456
15.02.2021 10:01:04: NewFolder: l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456
15.02.2021 10:02:01: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\F2345678901234567890.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\F2345678901234567890.txt
15.02.2021 10:02:01: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\H1234567890123.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\H1234567890123.txt
15.02.2021 10:02:04: Copy: h:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\G2345678901234567890.txt -> l:\A23456789012345678901234567890123\B234567890123456789012345678901234567890123456789\C23456789012345678901234567890123456789012345678901234\D2345678901234567890123456789012345678901234567890123456789012345678901234567890123456\E23456\G2345678901234567890.txt
In the log-file you can see my file-structure i have copied. The text-files are 6Byte long. It is important to use the same file-structure as I do.
I noticed in the log-file that the copy order changed when I wait longer to press the button!?!
And in the bad case i have to press "reread source" after copying to see my new folders in the destination directory.

I hope that helps.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Option "Copy date/time from directories" does not work correctly

Post by *gdpr deleted 6 »

I can confirm the issue observed by beaker, following the instructions in his last post and replicating the exact folder structure as seen in the log.

All copied files and directories except the "E23456" directory receive their respective original last-write-time timestamps. "E23456" does NOT.

A clue to the cause of this bug is the order in which the files have been copied when the long-path dialog is allowed to linger (according to the log; my log entries match beakers log entries):

1. E23456\F2345678901234567890.txt
2. H1234567890123.txt
3. E23456\G2345678901234567890.txt

The relative file paths listed here are with respect to the common parent directory. Note that the copy process seems to copy the files out of order, first copying a file from the E23456 directory, then proceeding to copy the file outside the E23456 directory, and then copying the second file from the E23456 directory.

Compare this to the order of copying when not letting the long-path dialog linger (the "good case"):

1. E23456\F2345678901234567890.txt
2. E23456\G2345678901234567890.txt
3. H1234567890123.txt


Now, to dig deeper, lets take a look with ProcMon (or a similar tool) at the I/O operations done by TC when following beakers "bad case" instructions.
ProcMon screenshot: https://imgur.com/a/Zoa5hDR

You'll notice that not only the file copy operation is out-of-order, but so is setting the timestamp for the E23456 directory too.

In the ProcMon screenshot, note the entry on the top encircled in red: That is TC setting the last-write-time timestamp of the E23456 directory to its original source value.

Further down in ProcMon (the other, bigger red rectangle at the bottom of the screenshot), you'll see TC copying E23456\G2345678901234567890.txt. Remember, after it has already set the timestamp for the E23456 directory. Copying E23456\G2345678901234567890.txt will now cause the last-write-time timestamp of E23456 being set to the current time.

Kaboom!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Option "Copy date/time from directories" does not work correctly

Post by *ghisler(Author) »

This happens because of the delayed error warning to the user.
Normally TC creates the target folder, then copies the files to it, and then sets the folder timestamp.

Now when a file can't be copied, TC can delay the error and copy all the rest of the files, so a long copy operation doesn't get interrupted in the middle because one file. But when this file is finally copied at the end, the target folder has long been left, and the timestamp has been copied. I don't currently see a way to fix this. If this bothers you, you can disable the delayed error message:
wincmd.ini
[Configuration]
SkippedFileCopy=0
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Option "Copy date/time from directories" does not work correctly

Post by *ghisler(Author) »

I found a solution for the upcoming TC 10: If a folder was created, and the length of the list of skipped files increased, then I add the folder to the list of skipped files so the timestamp will be copied a second time later. So far this seems to work.
Author of Total Commander
https://www.ghisler.com
CoolWater
Power Member
Power Member
Posts: 734
Joined: 2003-03-27, 16:33 UTC

Re: Option "Copy date/time from directories" does not work correctly

Post by *CoolWater »

Is there already an approx. date/month for a public beta test for TC10? I didn't find any information so far...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Option "Copy date/time from directories" does not work correctly

Post by *ghisler(Author) »

Currently it's still planned for this month, there was a slight delay because I found a nice library I wanted to add to the new media player.
Edit: Sorry, it will be early March, I didn't take into account that February only had 28 days.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Option "Copy date/time from directories" does not work correctly

Post by *ghisler(Author) »

This should be fixed in Total Commander 10 beta, please test it!

21.02.21 Fixed: With SkippedFileCopy and copying of directory timestamps enabled, when a file was initially skipped and copied at the end, the parent folder timestamp was not copied (32/64)
Author of Total Commander
https://www.ghisler.com
User avatar
beaker
Junior Member
Junior Member
Posts: 3
Joined: 2021-02-13, 23:38 UTC

Re: Option "Copy date/time from directories" does not work correctly

Post by *beaker »

Now it works for me.
Thank you very much.
Post Reply