Allow entering folders inside archives via cd command

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Allow entering folders inside archives via cd command

Post by *MVV »

Currently cd command doesn't allow entering archive folders, i.e. this doesn't work:

Code: Select all

cd D:\test.zip\Folder\
Please make it possible, also for cd command via WM_COPYDATA.

(Currently it seems to be working when we're already in this archive, but it doesn't work in general case.)
Last edited by MVV on 2018-01-18, 10:52 UTC, edited 1 time in total.
User avatar
Dalai
Power Member
Power Member
Posts: 9352
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

This might be difficult to do with archives that don't contain directories but relative paths. See the code blocks in this post in the German forum for an example. The upper block contains some directories, the lower one doesn't (only relative paths to the files within the archive). The thread itself is about the TC search and why it doesn't find some directories in ZIP files, but my guess is that your suggestion would pose a similar problem/issue.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Until this is implementet you can do this:

Make two external commands
[em_zipfolder1]
cmd=cd D:\test.zip

[em_zipfolder2]
cmd=cd folder

And then make a button or a command that combines the two:

cmd=em_zipfolder1,em_zipfolder2

This works due to the facts that once yiou are inside a zip file cd works for folders again
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

With 9.20b1 using IgnoreDirErrors=1 it is really confusing: it looks like TC have entered an archive but an error is displaying instead of archive folder contents, and TC is unable to go level up. TC should try opening an archive and then change directory...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48012
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

With IgnoreDirErrors=1, TC just sees that
D:\test.zip\Folder\
isn't a valid directory, so it shows the error instead of acting on it.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Support for MVV's vote.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

By email I suggested additional IgnoreDirErrors values to ignore errors separately for dirs that have access denied error and dirs that don't exsist. Maybe such additional value could be a good solution to define behavior for archives too?

To make it fully customizable, I also suggested additional values to tell TC to ignore arrors with or without error messages (like access denied or path not found, so after TC may either go directly to such dir ignoring an error, or after showing an error message). Currenly it's possible to see such a difference with IgnoreDirErrors=1 by trying e.g.
cd %windir%\ServiceProfiles\LocalService - go directly to a dir with <Read error!>
cd %windir%\ServiceProfiles\LocalService\ - go to a dir with <Read error!> if NOT to choose "As Administrator" in elevation request (at least that's how it behaves here on Vista.)
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

DrShark wrote:Maybe such additional value could be a good solution to define behavior for archives too?
I don't think it's a good idea. It's better to spent some time and implement entering into archives (since it's a desired and useful feature) than spent some time and implement a workaround for lacking functionality...

Some notes on MVV's idea:
- a time of operation is not critical when parsing "cd" paths
- TC already parses "cd" paths, since it goes to the file defined at the end of the path
- it would be enough to parse all parts of the path (separated by ""), and than check if it is a folder, an archive file or a normal file.

Regards
Post Reply