ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *DrShark »

Currently ZIPFROMLIST internal command packs the source paths as they are stored, except the drive letter, in the list which is passed to this command.
In the list, the absolute paths are stored, so if we're in c:\test\ with a file "name.ext" packing that file with a ZIPFROMLIST button, in the target archive the file "name.ext" will be inside of /test/ directory.
Since I rarely need upper directory tree in the file, as a workaround I currently use a subst command to make currrent TC's path as a root of a drive and then pack the files/dirs I need with ZIPFROMLIST command from that drive. This workaround requires additional actions each time when archive is created, so my suggestion is to add a parameter for ZIPFROMLIST command make it work more like Alt+F5 packing which stores only the paths relative to the source directory.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50561
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *ghisler(Author) »

ZIPFROMLIST supports relative paths - relative to the location of the list file. The files will be packed with these relative paths only.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16034
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *petermad »

2DrShark

A command like this works perfectly to pack with relative path:

Code: Select all

[em_zipfromlist]
cmd=ZIPFROMLIST -o
param="%O.zip" %UF
menu=Pack selected items to archive with name as file under cursor - in same folder
button=wcmicons.dll,30
If you use %UL instead of %UF, then you will get full path in the archive.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *DrShark »

2petermad
Thanks, with %UF it works!
My changed button now:

Code: Select all

TOTALCMD#BAR#DATA
ZIPFROMLIST -10
"%O%E.zip" %UF
%COMMANDER_PATH%\TOTALCMD64.EXE,21
Pack ZIPX


-1
Topic can be moved to English forum.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
petermad
Power Member
Power Member
Posts: 16034
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *petermad »

I noticed that you used 10 for compression rate - and it works, even though the specification only mentions 9 as max value:
history.txt wrote:22.01.13 Added: Buttonbar command ZIPFROMLIST now supports parameters: -m move, -o overwrite without asking, -0 .. -9 compression rate, -c0 encrypt (zip20), -c1 AES128, -c2 AES192, -c3 AES256, -c0pass .. -c3pass encrypt with given password (32/64)
I will make a report about that.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *DrShark »

petermad wrote: 2021-03-16, 22:41 UTCI noticed that you used 10 for compression rate - and it works
Yes, I use rate 10 with ZIPFROMLIST when I need archive with higher compression, and with Alt+F5 I pack to ZIP with compression rate 9 when I need more compatible ZIP files.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: ZIPFROMLIST command: request for additional parameter to pack only relative paths to source dir

Post by *Hacker »

Moderator message from: "Hacker"

Moved to the English forum.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply