archive

How to unzip a 7zip archive in Android?

笑着哭i 提交于 2019-12-19 07:23:13
问题 I have a 7zip archive which contains some hundred files separated into different directories. The target is to download it from a FTP server and then extract it on the phone. My problem is that the 7zip SDK doesn't contain a lot. I am looking for examples, tutorials and snippets regarding the decompression of 7z files. (Decompression via Intent is only a secondary option) 回答1: Go here: LZMA SDK just provides the encoder and decoder for encoding/decoding the raw data, but 7z archive is a

How to zip a folder and file in python?

社会主义新天地 提交于 2019-12-19 05:54:08
问题 I've got a folder called: 'files' which contains lots of jpg photographs. I've also got a file called 'temp.kml'. I want to create a KMZ file (basically a zip file) which contains the temp.kml file AND the files directory which has the photographs sitting inside it. Here is my code: zfName = 'simonsZip.kmz' foo = zipfile.ZipFile(zfName, 'w') foo.write("temp.kml") foo.close() os.remove("temp.kml") This creates the kmz file and puts the temp.kml inside. But I also want to put the folder called

How can I decompress an archive file having tar.zst?

二次信任 提交于 2019-12-18 18:51:12
问题 I do not know how I can decompress a file having tar.zst extension and even though I did look for solutions on the Internet I ended up having nothing useful regarding the matter. 回答1: The extention .zst means that the archive is compressed by zstd. https://github.com/facebook/zstd The tar command has an option -I (--use-compress-program) to specify a command for compression/decompression. You can use it as follows. $ tar -I zstd -xvf archive.tar.zst 回答2: Decompress it in Terminal. unzstd

Move rows from TableA into Table-Archive

女生的网名这么多〃 提交于 2019-12-18 13:38:52
问题 Is it possible to move rows that are 3 days old into an other table called "Table_Archive" automatically in mysql ones a week? tableA ex: ID | stringvalue | Timestamp 1 | abc | 2011-10-01 2 | abc2 | 2011-10-02 3 | abc3 | 2011-10-05 4 | abc4 | 2011-10-10 5 | abc5 | 2011-10-11 After the move tableA: ID | stringvalue | Timestamp 4 | abc4 | 2011-10-10 5 | abc5 | 2011-10-11 Table_Archive: ID | stringvalue | Timestamp 1 | abc | 2011-10-01 2 | abc2 | 2011-10-02 3 | abc3 | 2011-10-05 And when new

Object files not properly added to archive on mac

我是研究僧i 提交于 2019-12-18 07:08:38
问题 I am trying to build an archive from a collection of object files. I am doing this with ar -rs my_archive.a foo.o bar.o other_object_files.o . On a linux machine everything is fine but when I try the very same command on my mac it seems like only some object files are added. This results in undefined symbols corresponding to subroutines in, let's say, other_object_files.o . Moreover, if I try to manually link the object files that gave rise to undefined symbols, I can properly build the

How to zip or tar a static folder without writing anything to the filesystem in python?

时光毁灭记忆、已成空白 提交于 2019-12-17 21:21:50
问题 I know about this question. But you can’t write to filesystem in app engine (shutil or zipfile require creating files) . So basically I need to archive something like /base/nacl using zip or tar, and write the output to the web browser asking the page (the output will never exceed 32 Mb) . 回答1: It just happened that I had to solve the exact same problem tonight :) This worked for me: import StringIO import tarfile fd = StringIO.StringIO() with tarfile.open(mode="w:gz", fileobj=fd) as tgz: tgz

c# sharpziplib adding file to existing archive

蓝咒 提交于 2019-12-17 20:46:04
问题 am trying to add a file to an existing archive using the following code. When run no errors or exceptions are shown but no files are added to the archive either. Any ideas why? using (FileStream fileStream = File.Open(archivePath, FileMode.Open, FileAccess.ReadWrite)) using (ZipOutputStream zipToWrite = new ZipOutputStream(fileStream)) { zipToWrite.SetLevel(9); using (FileStream newFileStream = File.OpenRead(sourceFiles[0])) { byte[] byteBuffer = new byte[newFileStream.Length - 1];

Example of how to use PyLZMA

不打扰是莪最后的温柔 提交于 2019-12-17 19:35:30
问题 I want to use PyLZMA to extract a file from an archive (e.g. test.7z) and extract it to the same directory. I'm a newbie to Python and have no idea how to start. I've done some googling and found some examples and docs, but I don't understand how they work. Could someone please post the basic code for what I want to do so that I can start to work and understand? 回答1: Here is a Python class to handle the basic functionality. I have used it for my own work: import py7zlib class SevenZFile

How to extract a single file from a remote archive file?

混江龙づ霸主 提交于 2019-12-17 18:41:37
问题 Given URL of an archive (e.g. a zip file) Full name (including path) of a file inside that archive I'm looking for a way (preferably in Java) to create a local copy of that file, without downloading the entire archive first . From my (limited) understanding it should be possible, though I have no idea how to do that. I've been using TrueZip, since it seems to support a large variety of archive types, but I have doubts about its ability to work in such a way. Does anyone have any experience

Exporting / Archiving changed files only in Git

岁酱吖の 提交于 2019-12-17 17:39:06
问题 Is there a simple way to export / archive only the changed files from a given commit or series of commits in git? I can't seem to find clear instructions to do this (and I'm new to Linux/Git). I am using msysgit, and for the most part I'm fine with deploying entire repositories but in many cases it is much more efficient to deploy small fixes a few files at a time. Pushing/pulling/installing git on the remote servers isn't really an option as my level of access varies between projects and