7zip

Unzip a file in c# using 7z.exe

混江龙づ霸主 提交于 2019-11-27 08:42:12
问题 I'm trying to unzip a file from a winform application. I'm using this code : string dezarhiverPath = @AppDomain.CurrentDomain.BaseDirectory + "\\7z.exe"; ProcessStartInfo pro = new ProcessStartInfo(); pro.WindowStyle = ProcessWindowStyle.Hidden; pro.FileName = dezarhiverPath; pro.Arguments = @" e c:\TEST.ZIP"; Process x = Process.Start(pro); x.WaitForExit(); The code doesn't return error but doesn't anything. I tried this command also from cmd : K:\>"C:\Test\7z.exe" e "c:\TEST.ZIP" but in cmd

How to read from a text file compressed with 7z?

做~自己de王妃 提交于 2019-11-27 05:54:18
问题 I would like to read (in Python 2.7), line by line, from a csv (text) file, which is 7z compressed. I don't want to decompress the entire (large) file, but to stream the lines. I tried pylzma.decompressobj() unsuccessfully. I get a data error. Note that this code doesn't yet read line by line: input_filename = r"testing.csv.7z" with open(input_filename, 'rb') as infile: obj = pylzma.decompressobj() o = open('decompressed.raw', 'wb') obj = pylzma.decompressobj() while True: tmp = infile.read(1

How to read contents of 7z file using python

為{幸葍}努か 提交于 2019-11-27 05:16:32
How can I read and save the contents of 7z. I use Python 2.7.9, I can extract or Archive like this, but I can't read contents in python, I only listing the file's contents in CMD import subprocess import os source = 'filename.7z' directory = 'C:\Directory' pw = '123456' subprocess.call(r'"C:\Program Files (x86)\7-Zip\7z.exe" x '+source +' -o'+directory+' -p'+pw) You can use either libarchive or pylzma . If you can upgrade to python3.3+ you can use lzma , which is in the standard library. I ended up in this situation where I was forced to use 7z, and also needed to know exactly which files were

How to use LZMA SDK to compress/decompress in Java

假装没事ソ 提交于 2019-11-27 04:16:41
问题 http://www.7-zip.org/sdk.html This site provide a LZMA SDK for compress/decompress files, I would like to give it a shot but I am lost. Anyone got experience on this? Or a tutorial? Thanks. 回答1: Short answer: don't The 7zip sdk is old and unmaintained and it's just a JNI wrapper around the C++ library. A pure Java implementation on a modern JVM (1.7+) is as fast as a C++ one and has less dependecies and portability issues. Have a look at http://tukaani.org/xz/java.html XZ is a file format

Using 7-Zip from Delphi?

若如初见. 提交于 2019-11-27 03:50:53
I would like to use the 7-Zip DLLs from Delphi but have not been able to find decent documentation or examples. Does anyone know how to use the 7-Zip DLLs from Delphi? Oliver Giesen As of release 1.102 the JEDI Code Library has support for 7-Zip built into the JclCompression unit. Haven't used it myself yet, though. Expanding on Oliver Giesen's answer, as with a lot of the JEDI Code Library, I couldn't find any decent documentation, but this works for me: uses JclCompression; procedure TfrmSevenZipTest.Button1Click(Sender: TObject); const FILENAME = 'F:\temp\test.zip'; var archiveclass:

Python3: lzma unpack .7z file

♀尐吖头ヾ 提交于 2019-11-27 03:15:19
问题 I would like to unpack a .7z file. According to this question I can use the lzma package to do this. I was expecting something like import lzma #... with lzma.open('myFile.7z') as f: f.extractall('.') To extract the file into the current directory but it seems something like this does not exist. Furthermore trying something like import lzma #... with lzma.open('myFile.7z') as f: file_content = f.read() print(file_content) did yield _lzma.LZMAError: Input format not supported by decoder . How

How to programmatically extract / unzip a .7z (7-zip) file with R

大憨熊 提交于 2019-11-27 00:44:03
问题 I'm trying to automate the extraction of a number of files compressed with 7-zip. I need to automate this process, because a) there are many years of data I'd like to unlock and b) I'd like to share my code with others and prevent them from repeating the process by hand. I have both WinRAR and 7-zip installed on my computer, and I can individually open these files easily with either program. I've looked around at the unzip untar and unz commands, but I don't believe any of them do what I need

Utilizing multi core for tar+gzip/bzip compression/decompression

廉价感情. 提交于 2019-11-26 23:45:34
问题 I normally compress using tar zcvf and decompress using tar zxvf (using gzip due to habit). I've recently gotten a quad core CPU with hyperthreading, so I have 8 logical cores, and I notice that many of the cores are unused during compression/decompression. Is there any way I can utilize the unused cores to make it faster? 回答1: You can use pigz instead of gzip, which does gzip compression on multiple cores. Instead of using the -z option, you would pipe it through pigz: tar cf - paths-to

Error Creating a 7-zip installer package

六眼飞鱼酱① 提交于 2019-11-26 23:20:16
If this is not the correct place to ask this, I apologize. I use 7zip to create an installer package. Recently, my computer was updated, and I can no longer get it to work. I use a Windows Installer from Visual Studio 2010 to create the installation package, which I add to a file called setup.7z. I have confirmed that the files are archived correctly. I then call copy /b 7zsd.sfx + config.txt + setup.7z setup.exe which packages everything into a single file called " setup.exe ". Clicking on this would start the installer. After the update, I can still make the file, and it looks just fine.

PowerShell script not zipping correct files

為{幸葍}努か 提交于 2019-11-26 20:59:27
Function Zip { Param ( [string]$zipFile , [string[]]$toBeZipped ) $CurDir = Get-Location Set-Location "C:\Program Files\7-Zip" .\7z.exe A -tzip $zipFile $toBeZipped | Out-Null Set-Location $CurDir } $Now = Get-Date $Days = "60" $TargetFolder = "C:\users\Admin\Downloads\*.*" $LastWrite = $Now.AddDays(-$Days) $Files = Get-Childitem $TargetFolder -Recurse | Where {$_.LastWriteTime -le "$LastWrite"} $Files Zip C:\Users\Admin\Desktop\TEST.zip $Files I am testing out this script I found online. My problem is that instead of zipping the files in the target folder, it is copying and zipping the