Page 1 of 1
Extract Zip file to Temp folder
Posted: 19 Jul 2010 12:31
by Jibz
This script attempts to mimic looking at and extracting from a zip file as a folder in XY. It's far from ideal, but since there is no built in support I thought it would be an interesting first project to try the scripting.
Code: Select all
"Extract Zip to Temp"
// check extension
if (<curext> LikeI "zip") {
// let user abort on "large" files (2mb here)
if (<cursize> > 2*1024*1024) {
msg "Zip file is larger than 2 MB.<br><br>Are you sure you want to extract?", 1
}
// create a (relatively) unique temp folder name
set $p, "%tmp%\<curname>_<date yyyymmddhhnnss>_" . rand(0,65536);
set $z, "<curitem>";
// create temp folder and unzip file there
new "$p", dir;
goto $p;
run "unzip -qq $z"
}
It takes the current file and checks if it has zip extension. If so, it creates a temporary folder in the users temp folder and extracts the zip file there and goes to it. I put in a check against large files just to avoid extracting something huge by mistake. I am using InfoZip's unzip.
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 12:36
by admin
FYI, I'm currently researching the possibilities of adding ZIP support.
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 12:41
by Jibz
That is great news indeed!
It's probably the one single thing that would improve my use of XY most. I'm not fussed about creating archives, but being able to "go into" an archive like it is a folder and extract files by copying is a huge usability upgrade over having to use external tools or hacks like this imho.
I am excited and looking forward to hearing more

.
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 12:45
by admin
Do you expect to see the archives in the tree then?
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 13:04
by Jibz
admin wrote:Do you expect to see the archives in the tree then?
Not really. At least in DO when you enter an archive it does not appear in the tree as far as I can tell.
Basically opening an archive works on the list just like entering a folder. You get a list of the contents just like if you were looking at a folder with it, and you can navigate it inside the list as you would a folder.
As a minimum it should be possible to extract files/folders by drag'n'drop or by copying them.
Pressing the 'Up' button should get you back to the containing folder just as if the archive had been a folder.
In DO/TC you can 'view' a file inside an archive as well, I think that's done by extracting the file to the temp folder and viewing it from there.
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 13:24
by Stefan
For me, as i have seen/used this before, it's also an
- go inside the archive and show it as an folder
- view / edit / browse
- copy/extract
- add new items
- go out of archive/folder and show the archive file again
Additional thoughts:
Adding to the archive works by drag&drop too.
This whole feature is not limited to ZIP archives.
There could be an config somewhere with path to all executables and corresponding options.
I mean: for me it's an "go in/use/go out" thing.
If i "go out" all temporally files are deleted. Ans so not really an entry in path needed.
--
But as addition, maybe there could be an option to keep this temporally temp-folder
(and then show it in tree too)
And the user has to delete it on its own.
(could be nifty for big archives)
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 13:28
by zer0
Jibz wrote:admin wrote:Do you expect to see the archives in the tree then?
Not really. At least in DO when you enter an archive it does not appear in the tree as far as I can tell.
I would expect them to be shown in the tree, but with a possible turn-off switch. Natively, they are referred to as Compressed (zipped) Folders (and are shown as folders in Explorer since Vista), so they should be displayed as folders in the tree (with their icon).
Re: Extract Zip file to Temp folder
Posted: 19 Jul 2010 15:03
by Jibz
I am going to hesitantly throw the word "plugin" into the discussion here.
As far as I can tell XY does not have any published interface for plugins, but it is tempting to start fantasizing about a simple filesystem plugin interface that could allow access to archives, ftp, S3, etc.
The basic four operations, list files, extract file, add file and delete file are enough to interface quite a few things not supported at the moment.
Of course once you open up for that kind of thing it brings with it a ton of problems and work as well.
Personally I would be more than happy to just have read-only access to zip (and possible rar) files

.
Re: Extract Zip file to Temp folder
Posted: 18 Sep 2011 10:27
by Crash&Burn
Any furtherance on browsing zip/rar's within XYplorer's normal file view?
Re: Extract Zip file to Temp folder
Posted: 18 Sep 2011 19:46
by zer0
Crash&Burn wrote:Any furtherance on browsing zip/rar's within XYplorer's normal file view?
Check the roadmap link in my signature -- things are usually done in that order.