Page 1 of 1

Remember autorename data during copy

Posted: 2016-12-15, 15:44 UTC
by nemadeka
Apology:
a) I did not search the forum for this
b) My current version is 7.57

I often have to copy files, from a directory tree to a single folder, which have the same filename, like 'email.doc', for batch processing.

TC has this nice feature which allows me to autorename copied files. Very convenient.

However, when it comes to a hundred of such files, TC behaves like an old, forgetful lady:
email.doc exists!
trying to rename as email2.doc!
email2.doc exists!
trying to rename as email3.doc!
email3.doc exists!
trying to rename as email4.doc!

until it discovers that email125.doc has not been taken yet, and this repeats itself with the next email.doc. This slows TC dows a lot, you can check it.

I would keep the recently used autorenaming patterns/pairs in memory, or somehow else try to bypass this checking of all filenames in sequence every time.

Posted: 2016-12-15, 16:24 UTC
by MVV
I don't know how it was in your ancient version but in current TC versions there is an option to auto-rename on collision, it is available from More Options >> button in overwrite dialog.


How many files do you have? I've tried with 700+ files with sequential names and auto-renaming is still fast when I copy a file to that folder with auto-rename...

Re: Remember autorename data during copy

Posted: 2016-12-15, 18:26 UTC
by Stefan2
Apology:
nemadeka wrote:b) My current version is 7.57

>>> Total Commander 9.00a final available






 

Posted: 2016-12-16, 10:33 UTC
by nemadeka
Thanks for your understanding and feedback.

My TC version has an option to auto-rename on collision, I use it, as explained in my post.

I don't want to upgrade TC, the current versio suits me fine.

No matter if it is "fast" or not, on a particular system, the mechanics is still illogical, clumsy, that's all I wanted to say.

Posted: 2016-12-16, 12:19 UTC
by MVV
Well, I think that name collision is rare enough to make this algorithm sufficiently efficient...

Posted: 2016-12-16, 13:11 UTC
by Horst.Epp
nemadeka wrote:Thanks for your understanding and feedback.

My TC version has an option to auto-rename on collision, I use it, as explained in my post.

I don't want to upgrade TC, the current versio suits me fine.

No matter if it is "fast" or not, on a particular system, the mechanics is still illogical, clumsy, that's all I wanted to say.
Commenting outdated software which you use for no real reason
is almost useless because most other users don't have your version since 2012.

Posted: 2016-12-21, 20:50 UTC
by Hacker
Let me also join in to comment on how I dislike how stuff worked 20 years ago. :roll:

Roman

Posted: 2016-12-22, 01:21 UTC
by petermad
2nemadeka
I don't want to upgrade TC, the current versio suits me fine.
Hmm, apparantly not! ;-)

Posted: 2017-01-06, 05:39 UTC
by nemadeka
Happy New Year to everyone.

Folks, generally this thread is my message to the developer, where you could contribute by replicating my *real-life* situation on your setup and providing tips.

The developer could read the code and figure it out whether my suggestion is easy to implement and/or worth implementing, or have already been implemented.

You don't need to be a rocket scientist to understand that my suggestion is clear, reasonable and makes TC a bit faster and more rational, this is what most people like in TC.

I've not expected to find meaningless flame posts here. Please, hold your horses next time.

Posted: 2017-01-06, 10:58 UTC
by MVV
Well, it is hard to optimize everything so usually people optimize bottlenecks. Sorry but I doubt that this place is a bottleneck because it requires a very specific scenario.

And, even if Christian will implement something that you ask, this feature won't be available in TC 7.57...

Regarding your task, I believe that it should be done in other way, e.g. you can make a button that will simply copy focused file (or even selected files) to that dir and append timestamp or a random number to its name to make it unique, and it will be done instantly and with no questions from TC.
E.g. you can use a button with such BAT file (button parameters are "%T" %WL):

Code: Select all

@echo off
if -%1==- echo Parameters: "%%T" %%WL & pause & goto :EOF
set "ARG_0=%~dpnx0"
set "ARG_1=%~dpnx1"
set "ARG_2=%~dpnx2"
powershell.exe -NoProfile "iex (([IO.File]::ReadAllText($Env:ARG_0)) -replace '^(.*\n)*?.*<::::>.*\n', '')" & goto :EOF


$targetPath = $Env:ARG_1;
$fileListPath = $Env:ARG_2;
$stamp = [DateTime]::Now.ToString('yyMMdd-HHmmss,fff');
$index = 0;
foreach ($file in @(gc $fileListPath)) {
	$file = gi $file;
	cp $file "$targetPath\$($file.BaseName) ($stamp-$(0 + $index++))$($file.Extension)";
}

Posted: 2017-01-08, 14:24 UTC
by nemadeka
2MVV
Thanks for your tip, looks like the optimal solution for me.

--
I downloaded TC 9.0a and tried it on a desktop PC with some 3GHz Celeron and Win7, Windows performance rating is about 6.0 (this is not really important though).

I created a folder tree containing 7810 files named codes.txt, file size - 402 bytes.

When I copied this folder tree to another forlder on the same partition, the copying took 25 seconds.

Then, I performed a search in the same folder, then selected all files in the listbox and copied them into the same empty target folder with the option "autorename copied". After 18 minutes TC copied 53% of the files, and the process kept slowing down all the time, so I cancelled it.

So, the opinions about the age of my workhorse PC or the TC version are groundless, it is the mechanics, the "forgetfulness" of the "autorename copied" option that causes gradual slowdown. (I hope that we all agree that 25 seconds and 18 minutes *are* a bit different).

I do not insist on anything. That was free advice and user testing.

Thank you for your kind attention.

UPD: On my 10-year-old WinXP laptop WinRar unpacks the folder tree into a single folder, with autorename within 7 minutes, I don't know, why.