archive

Zip folder in C#

廉价感情. 提交于 2019-11-26 05:28:02
问题 What is an example (simple code) of how to zip a folder in C#? Update: I do not see namespace ICSharpCode . I downloaded ICSharpCode.SharpZipLib.dll but I do not know where to copy that DLL file. What do I need to do to see this namespace? And do you have link for that MSDN example for compress folder, because I read all MSDN but I couldn\'t find anything. OK, but I need next information. Where should I copy ICSharpCode.SharpZipLib.dll to see that namespace in Visual Studio? 回答1: This answer

Archive the artifacts in Jenkins

陌路散爱 提交于 2019-11-26 04:17:43
问题 Could someone please explain to me the idea of artifacts in the build process? I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case, I get a jar file that\'s ready to install. Is that considered to be the artifact? Where should I tell my build script to put the jar file? In the workspace directory? My jar file gets a unique filename depending on variables like BUILD_ID and such, how can I tell Jenkins which jar file to pick?

How do I extract a tar file in Java?

浪子不回头ぞ 提交于 2019-11-26 02:33:31
问题 How do I extract a tar (or tar.gz, or tar.bz2) file in Java? 回答1: Note: This functionality was later published through a separate project, Apache Commons Compress, as described in another answer. This answer is out of date. I haven't used a tar API directly, but tar and bzip2 are implemented in Ant; you could borrow their implementation, or possibly use Ant to do what you need. Gzip is part of Java SE (and I'm guessing the Ant implementation follows the same model). GZIPInputStream is just an

How to create a zip archive of a directory in Python?

﹥>﹥吖頭↗ 提交于 2019-11-25 23:39:14
问题 How can I create a zip archive of a directory structure in Python? 回答1: As others have pointed out, you should use zipfile. The documentation tells you what functions are available, but doesn't really explain how you can use them to zip an entire directory. I think it's easiest to explain with some example code: #!/usr/bin/env python import os import zipfile def zipdir(path, ziph): # ziph is zipfile handle for root, dirs, files in os.walk(path): for file in files: ziph.write(os.path.join(root