Extracting a zip file to its own folder

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
CookieMonster

Re: Extracting a zip file to its own folder

Post by CookieMonster »

Sammay - I do get a text box which says ks.dat<crlf>zipfile.zip, therefore everything works as it should :)

CookieMonster

Re: Extracting a zip file to its own folder

Post by CookieMonster »

Based on the only information you seem willing to provide:

Code: Select all

text zip_extract("C:\2\5.zip","D:\2","image1.png|image2.png");
That will attempt to extract image1.png and image2.png from the archive C:\2\5.zip to the target path D:\2. Assuming those files are within that archive this should create D:\2\image1.png and D:\2\image2.png. After which zip_extract will return D:\2 which is then displayed by the text dialog.
Once again, you have explained exactly how and where I want the files in the zip to be placed. :appl:

I have successfully extracted the zip file using the XY default extract methods, there is nothing wrong with the zip file. Running the zip_extract() command does not extract the specific files I request out of the zip file.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Extracting a zip file to its own folder

Post by bdeshi »

CookieMonster wrote:Running the zip_extract() command does not extract the specific files I request out of the zip file
Come on, since the script I posted works all right, there's certainly something wrong about your usage of zip_extract().
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Extracting a zip file to its own folder

Post by TheQwerty »

CookieMonster wrote:Running the zip_extract() command does not extract the specific files I request out of the zip file.
Running zip_extract() cannot read your mind so it just extracts all items from "the selected archive into an auto-named folder in the current path."

Try passing the correct arguments to zip_extract.

murdock01
Posts: 55
Joined: 08 Nov 2010 19:35

Re: Extracting a zip file to its own folder

Post by murdock01 »

I dont know if this will help because I did not read the whole post as I need to leave soon but ...
back in the day before XY had zip support I used this script

Code: Select all

run """<xydrive>\PApps\7-Zip\7z.exe"" x ""<curitem>"" -o*""", , ,0
This script runs the 7zip extractor in my portable apps directory. I triggered this with the following:

Code: Select all

"7Zip" 7z;zip;gzip;gz;tgz;tar;rar;cab;arj;rpm;deb;bz2>::load "<xydata>\scripts\7z.xys"
this is a custom file association.

So basically I download a zip file then double click it. The custom file association reads the extension, then executes the 7z.xys ) the first code block). The xys script runs 7zip which extracts the file into a new subfolder, in the same directory as the zip file, named the same as the zip file. Very quick and I have never had any issues.

This will only do one file at a time but it worked for me. You can modify it to accept more that one file and add more extensions to the association but here is what I have, Enjoy.

CookieMonster

Re: Extracting a zip file to its own folder

Post by CookieMonster »

Solved, it just worked !


Post Reply