Double checking a copy/move task and hash checks were successful + which files were over the path length/filename limit?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
MajoraZ
New Member
New Member
Posts: 1
Joined: 2024-05-07, 00:45 UTC

Double checking a copy/move task and hash checks were successful + which files were over the path length/filename limit?

Post by *MajoraZ »

Hello!
Somewhat lengthy contextual explanation of why I'm asking this
I have perhaps a weird set of questions here: I normally use Teracopy, which I am quite happy with, a few gripes aside: It's pretty intuitive and I greatly appreciate that as it copies or moves files around and verifies their hashes, it leaves a list of each individual file and it's status in terms of if the copy/move operation was successful, if the hash has been checked yet, if it matched or not, etc, which helps me feel safe/secure that everything was successfully copied or moved

The big issue I have, however, is that I have a lot of files that are over Window's normal filename/path length character limit: I do a lot of amateur archival stuff with niche archeology and history topics, and for a lack of a better option (if people know good metadata tagging or database tools, let me know!) I often have to stuff the century of creation, culture, country of origin, material, dimensions, etc in the filename and break Window's normal limit

Teracopy can't handle this well: Depending on the computer/teracopy installation i'm using and other variables I frankly have not been able to wrap my head around yet, Teracopy will either freeze, be unable to start the operation, or worst of all, will proceed with the move/copy operation but simply won't touch the over-the-limit files or will automatically rename them without notifying me that anything unusual happened.

Somebody suggested that Total Commander can copy over-the-limit files fine, and from my testing, it seems to indeed handle it well (there are some circumstances where even it can't force the operation through, I guess if the length is past an even greater threshold: I have noticed a second-limit past the normal one with some other software), but a major problem it has is that after copying or moving files, while it will ask me how to handle over-the-limit files and if it should be renamed or skipped or copied/moved anyways, there is otherwise no "feedback" on which files were or weren't copied/moved successfully or were over the limit or not?
Is there something I can crtrl+F for within Total Commander's log file, or some other setting I can activate to view a list of files in an operation that had different types of abnormalities, after the operation is finished? Be it that the moving/copying failed, or the hashes didn't match, or the file was over filename/path length character limit and it had to force the operation anyways, even if that forcing was successful?

I assume that if it doesn't outright give me an error pop up, everything went fine, but for my own sanity I'd like to be able to double check, and I do need to know which files were over the character limit, even if they were successfully moved/copied, so can compile a list of which files I need to try to shorten the names of in the future.
User avatar
nsp
Power Member
Power Member
Posts: 1912
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Double checking a copy/move task and hash checks were successful + which files were over the path length/filename li

Post by *nsp »

To add comment to a file, you can use descript.ion file (or alternate stream for ntfs only) this is fully supported by TC. but i do not know about TerraCopy.
Filename limitation if you have long path enabled this should not be an issue anymore. If you still want to check full filename for a target file you should do it before doing the copy or after a copy if you have a detailed log from terracopy.
To check before:
You can use an excel template doing a check from the list of file to copy (if you copy a full folder you can use dirbranch view to list all file and get the list in a file using SAVESELECTION list.txt) you can use target path len for each line and calculate destination length. With a conditional format if length is over 260 you can highlight too long files.

from a source, you can check destination folder afterward using compare feature of TC but only if you want to have synchronized folder and not only some files. In this case, you can use the LOADLIST command from the saved selection on the destination folder and see iff all the files are presents (same name).
User avatar
beb
Power Member
Power Member
Posts: 579
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Double checking a copy/move task and hash checks were successful + which files were over the path length/filename li

Post by *beb »

nsp wrote: 2025-04-20, 07:20 UTC To check before:
You can use an excel template doing a check from the list of file to copy (if you copy a full folder you can use dirbranch view to list all file and get the list in a file using SAVESELECTION list.txt) you can use target path len for each line and calculate destination length. With a conditional format if length is over 260 you can highlight too long files.
By the way, this could be automated, e.g., with PowerShell, as follows:
user-command (usercmd.ini):

Code: Select all

[em_test_longnames]
cmd=pwsh -c "%commander_path%\Plugins\PowerShell\longNames.ps1"
param=%WL %T
user-button:

Code: Select all

TOTALCMD#BAR#DATA
em_test_longnames

wciconex.dll


0
-1
PowerShell script (longNames.ps1)

Code: Select all

$time = [diagnostics.stopwatch]::StartNew()

function pathLength ($path){
if ($path.length -gt 260){$color = 'Yellow'} else {$color = 'Gray'}
'{0,3} {1}' -f $path.length,$path|Write-Host -f $color}

$files = @()

if ($args){

# take $files from %WL input TC parameter: %WL > $args[0] = $lines > $files, if any
foreach ($line in [IO.File]::ReadLines($args[0])){$files += [IO.FileInfo]$line}

# if %WL returns nothing : try to take $files from current folder, if any
if ($files.count -eq 0){
$files = Get-ChildItem -file -recurse -force}

# take $target path from %T input TC parameter: $args[1] = $target
$target = $args[1]

# if $files, process each one
if ($files.count -ge 1){
'processing...'|Write-Host -f Green

foreach ($file in $files){
# display source/target path length and path itself (if length is over 260, display in yellow)
pathLength $file.FullName
pathLength ([IO.Path]::combine($target+$file.FullName.substring(([string]$pwd).length+1)))
''
} # end of foreach $file loop
} else {'there are no input files...'|Write-Host -f Magenta}
} else {'no Total Commander arguments have been passed...'|Write-Host -f Red}

# finalizing
$time.Stop()
'{0} items processed for {1:mm}:{1:ss}.{1:fff}' -f $files.count,$time.Elapsed|Write-Host -f DarkCyan

pause
Illustration:
Image: https://i.imgur.com/okEAqPO.mp4
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Fla$her
Power Member
Power Member
Posts: 2981
Joined: 2020-01-18, 04:03 UTC

Re: Double checking a copy/move task and hash checks were successful + which files were over the path length/filename li

Post by *Fla$her »

nsp wrote: 2025-04-20, 07:20 UTC you can use target path len for each line and calculate destination length.
There is no need to calculate anything, there is an easier way.
It's enough to use the search in plugins after copying:
filexFullPathLen>259
Overquoting is evil! 👎
Post Reply