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 + '"')
View HTML in zip
Moderators: white, Hacker, petermad, Stefan2
- ghisler(Author)
- Site Admin
- Posts: 48104
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This is done because 99.9% of all programs could not handle files in archives. Maybe as an option.%P%N in the shortcut gives me the message "This function cannot be used with packed files!"
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com