XY Copy Handler can be beaten to its knees - maybe tweak the Help
Posted: 09 Dec 2024 04:20
Windows 10 x64, XY ~v26.50 (recent beta).
I recently wrote a script that captured a list of all folders in the current location, looked at each one, and if it met certain criterial copied it off to another folder on the same mechanical external drive.
In Settings | File Operations I had long ago enabled "Background processing" but had not noticed or enabled "Queue file operations".
Being short on either time, insight, experience, or skill - not sure which - I had the test + copy in a For Next loop carried out on a per-folder basis. So an SC Copy was being initiated on most of those loops, and these operations quickly stacked up to dozens. At which point many of the Copy ops froze, or silently quit. After a while I had to kill XY because it had stopped responding and the few visible copy progress boxes had stopped advancing.
My solution was to carry out the folder criteria checks and if appropriate add that folder's name to a string. Then when all checks were done, tell SC "CopyTo" to do the whole string which it completed one folder at a time (I suppose) with no problems.
Queueing would probably have prevented this, but that's not enabled by default and as mentioned I didn't run across it or think of it.
So I suggest that the Help for SC CopyTo could mention this possible problem and the best solution. Also btw in that same Help it could be made clear that the "source location" can be a delimited string of items. I wasn't sure that would or should work until I tried it.
Thx
I recently wrote a script that captured a list of all folders in the current location, looked at each one, and if it met certain criterial copied it off to another folder on the same mechanical external drive.
In Settings | File Operations I had long ago enabled "Background processing" but had not noticed or enabled "Queue file operations".
Being short on either time, insight, experience, or skill - not sure which - I had the test + copy in a For Next loop carried out on a per-folder basis. So an SC Copy was being initiated on most of those loops, and these operations quickly stacked up to dozens. At which point many of the Copy ops froze, or silently quit. After a while I had to kill XY because it had stopped responding and the few visible copy progress boxes had stopped advancing.
My solution was to carry out the folder criteria checks and if appropriate add that folder's name to a string. Then when all checks were done, tell SC "CopyTo" to do the whole string which it completed one folder at a time (I suppose) with no problems.
Queueing would probably have prevented this, but that's not enabled by default and as mentioned I didn't run across it or think of it.
So I suggest that the Help for SC CopyTo could mention this possible problem and the best solution. Also btw in that same Help it could be made clear that the "source location" can be a delimited string of items. I wasn't sure that would or should work until I tried it.
Thx