![]() Tried it for single file and works, but failed with subfolders. Sp = subprocess.Popen(cmd, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)Ĭat test.zip* > test.zip should also work, but not always imho. call 7z on the 001 ( 7z x test.zip.001 ).How can I merge and then unpack these archive files properly in Python? So I tried other ways to merge for example using cat cat test.part.* >test.rar, but those don't help. : could not find an executable program to extract format rar candidates are (rar,unrar,7z)Īfter some work I figured out that these merged files are corrupted (I copied it and try to unpack normally on windows using WinRAR, and encountered some problems). zip case), and then tried to unpack it by using patoolib: patoolib.extract_archive("test.rar", outdir="path here") I tried to unpack just the first file to see if my code would intelligently look for and pick up the remaining archive fragments, but it did not. With open(os.path.join(path_to_zip_file, zipName), "rb") as z:Īnd then, after merge, unpack it like thod" with zipfile.ZipFile(os.path.join(path_to_zip_file, "test.zip"), "r") as zipObj: With open(os.path.join(path_to_zip_file, "test.zip"), "ab") as f: When I merge them in Python like this: for zipName in zips: zip archive I had files like test.zip, test.z01, .99, etc. rar) file in parts (let's assume 100 parts x 20MB), and I am trying to find a way to unpack it properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |