View HTML in zip

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
icokk
Junior Member
Junior Member
Posts: 4
Joined: 2007-04-05, 21:58 UTC

View HTML in zip

Post by *icokk »

Firefox allows browsing in zip archives. URL must have the form

jar:file:///zip_path!path_in_zip

i.e.

jar:file:///c:/Program%20Files/Java/jdk1.6.0/jdk-6-doc.zip!/docs/api/help-doc.html

Using this feature comes very handy in totalcmd, because it's difficult to read htmls in an archive (simple "unpack and execute" loses all images/links and "unpack all and execute" is an overkill, as such archives tend to be very large).

I created a simple python script to translate path and execute. The problem is I'd like to bind it to a button or shorcut but using %P%N in the shortcut gives me the message "This function cannot be used with packed files!". Would it be possible to

1) lift the restriction about packed files
2) even better, use this feature automatically when I try to execute a zipped file associated with firefox (unfortunately it doesn't work with explorer)

import sys, os, re
file = sys.argv[1]
index = file.rfind(".zip\\")
if index >= 0:
file = "jar:file:///" + file[0 : index + 4] + "!" + file[index + 4 :]
file = re.sub(r"\\", "/", re.sub(r" ", "%20", file))
exename = r"c:\Program Files\Mozilla Firefox\firefox.exe"
os.spawnl(os.P_NOWAIT, exename, '"' + exename + '"', file)
else:
os.startfile('"' + file + '"')
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

%P%N in the shortcut gives me the message "This function cannot be used with packed files!"
This is done because 99.9% of all programs could not handle files in archives. Maybe as an option.
Author of Total Commander
https://www.ghisler.com
icokk
Junior Member
Junior Member
Posts: 4
Joined: 2007-04-05, 21:58 UTC

Post by *icokk »

Perhaps there could be another modifier e.g. %A that would work like %P but would also work in archives?
Post Reply