260-char path length limit in lists for usercmd.ini

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
LogicDaemon
Junior Member
Junior Member
Posts: 20
Joined: 2012-07-29, 18:12 UTC
Location: Russia
Contact:

260-char path length limit in lists for usercmd.ini

Post by *LogicDaemon »

Hi all.

I'm trying to integrate zpaq via usercmd.ini (code below) and custom script (on github).

Problem is that all paths in list files written by Total Commander are hard-truncated to 260 bytes. This is terrible. (yes, bytes, not even characters! Last character is one fit to 260-byte limit, string does not get cut in middle of UTF-8, so at least this is as bad as it could be).

Have any suggestions for workarounds?


Code: Select all

[em_zpaq_add]
menu=zpaq add
cmd=%comspec%
param=/C ""%%COMMANDER_PATH%%\AutoHotkey.exe" "%%COMMANDER_PATH%%\zpaq.ahk" a %UL "%T\""

[em_zpaq_list]
menu=zpaq list
cmd=%comspec%
param=/C ""%%COMMANDER_PATH%%\AutoHotkey.exe" "%%COMMANDER_PATH%%\zpaq.ahk" l %UL"

[em_zpaq_extract]
menu=zpaq extract
cmd=%comspec%
param=/C ""%%COMMANDER_PATH%%\AutoHotkey.exe" "%%COMMANDER_PATH%%\zpaq.ahk" x %UL "%T\""
Last edited by LogicDaemon on 2016-12-27, 16:47 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is not related to usercmd.ini, it is related to non-Unicode filelists, and you will get same behaviour if you run same command from buttonbar.

http://www.ghisler.ch/board/viewtopic.php?t=46901
http://www.ghisler.ch/board/viewtopic.php?t=46927
LogicDaemon
Junior Member
Junior Member
Posts: 20
Joined: 2012-07-29, 18:12 UTC
Location: Russia
Contact:

Post by *LogicDaemon »

okay, thanks, I'll rewrite ini with %WL and make the script aware.
User avatar
nsp
Power Member
Power Member
Posts: 1951
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

MVV wrote:It is not related to usercmd.ini, it is related to non-Unicode filelists, and you will get same behaviour if you run same command from buttonbar.

http://www.ghisler.ch/board/viewtopic.php?t=46901
http://www.ghisler.ch/board/viewtopic.php?t=46927
As pointed MVV thye only way is to use utf-16 filelist %WL.
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

A bit offtopic, but just out of curiosity:
Is such AHK script for calling ZPAQ really better than using my plug-in?
And yes, I'm aware that TC's wcx plug-ins are quite limited when it comes to using them for user commands.

But the ahk has at least two limitations, which you can hardly work around:
First, adding files will be limited by the max command line length (32k IIRC), because you use:

Code: Select all

Run %comspec% /C "%zpaqexe% a "%3%%arcName%.zpaq" %files% || PAUSE"
Second, zpaq might show a mix of internal and external files in some situations (it will compare a file set on disk to the one in the archive), so you might see/list files that are not in the archive for real.
TC plugins: PCREsearch and RegXtract
Post Reply