I use the adm-zip(Module NodeJs ) to zip Floder, with Method addLocalFolder().The operation end successfully, but when i try to unzip folder i get the Error 2 ' file or directory not exist!'as additional info i have the right size of zip when zip operation is end.
Thank you every one.
The archive files produced by adm-zip do not seem to work on certain systems. Try this: https://stackoverflow.com/a/15532326/1134405
Related
I am downloading a zip file from an API and trying to unzip it using Python shutil.
shutil.unpack_archive(file_name)
It gives weird behaviour, for some files it works, for others it shows the following error:
name.zip is not a zip file
There is no issue with the downloaded file, I am able to unarchive it manually.
Any help here would be appreciated.
You should use zipfile (for zip archives) or tarfile (for tar archives)
I want to extract a ZIP File with the .exe inside.
I want to execute the .exe inside the Zip to extract the Zip File.
Already tried it by executing: ZipDLL::extractall "$EXEDIR" "$DESTINATION"
I think that does not work, cause the .exe is stored in the TEMP Folder when opened, so it cannot find the.Zip file
So how do I extract that Zip when executing the .exe from inside the Zip?
Thanks for answers!
Your question does not make a lot of sense, you should just put the files inside the installer and not have a zip file at all.
Even if it made sense, it is not possible because where a exe is executed from when you double click it inside a zip file depends on the zip program you are using and there is no way of getting the path of the zip it was extracted from.
If for some reason you want to be able to update the files inside the zip file without rebuilding the installer you can use a cab file instead. The CabX plug-in supports extracting from cab files appended to the installer exe.
I try to download a tar.gz file and uncompress it on /tmp/apps.
However i don't want to uncompress it if the directory already exists.
If the file exists or even doesn't exist it is downloaded and uncompressed.
I cant find my code is missing a parameters on my exec block or if I made a mistake somewhere else.
I'm using Puppet 3.8.
Gist file of my puppet
Use the puppet/archive module, https://forge.puppet.com/puppet/archive. It will download the archive, check for existing files and even tidy up after itself.
How can I verify that the unzipped files are not corrupted after the extraction from the zip file?
Scenario: I am packaging some font files via 7zip and then during installation of the application I am unzipping it and copying it to some specific directory. In some cases, although my unzipping is successful my unzipped files are coming to be corrupted. I am not able to load the font files. Upon investigation, I found that they are somehow getting corrupted.
Is it possible that during extraction, extracted files can get corrupted?
What is the way to check if the extracted files are fine or corrupted?
I can test the zip file using -t flag which checks that all the files are correctly zipped in the zip files but what I want to check is that POST extraction whether the files corrupted or not?
Thanks
I need to get the content of archives and then I want to uncompress the selected one - but I dont want to uncompress the archives to know what's in it. I'd like to list and uncompress at least zip and rar, but (if that's possible) I don't want to be limited to only these two.
Can you advise good npm modules or other projects to achieve this?
Here's what I came up with:
zip
I found node-zip can only unzip files, but not list archive content.
rar
The best solution seems node-rar, but I can't install it on Windows.
node-uncompress This does what it says: It's an "Command-line wrapper for uncompressing various file types." So there is again no possibility to list archive content.
Currently I try to get node-uncompress to list files and hopefully it must never run cross-platform.
Solution:
I am now using 7zip with the node module node-7z instead of trying to get every archive working on its own. The corresponding site is: https://www.npmjs.com/package/node-7z
This library uses the OS independent archive manager 7zip. On Windows 7za is used. "7za.exe (a = alone) is a standalone version of 7-Zip". I've tested it on Windows and Ubuntu and it works great.
Update:
At Windows: Somehow I just got it working by adding 7za to the Path variables - not by adding 7za.exe to the "the same directory of your package.json file." like the description says.
Update 2:
On Windows 7za, that's referred in the node-7z post, cannot handle .rar-archives. So I'm using the "casual" 7-zip instead of 7za.exe. I just renamed the commanline 7z.exe to 7za.exe and added the 7-zip folder to the Path Variables.