Questions tagged [bzip2]

bzip2 is a Unix command used for compression and decompression of files. The main advantage of bzip2 is that it has a high compression ratio with reasonable speed.

bzip2 one of the most widely used free compression programs for the terminal.

It typically compresses files to within 10% to 15% of the best available techniques, whilst being around twice as fast at compression and six times faster at decompression.

The current version is 1.0.6, released 20 Sept 2010.

327 questions
11
votes
1 answer

How to compress a file with bzip2 in Python?

Here is what I have: import bz2 compressionLevel = 9 source_file = '/foo/bar.txt' #this file can be in a different format, like .csv or others... destination_file = '/foo/bar.bz2' tarbz2contents = bz2.compress(source_file, compressionLevel) fh =…
Lucas
  • 1,514
  • 3
  • 16
  • 23
11
votes
2 answers

PHP Enable bz2 Extension In Php.ini

I an trying to download a file using composer in php, but the file needs to be decompress with bzipped. Here is the error I get: [UnexpectedValueException] unable to decompress bzipped phar archive…
Alex Pelletier
  • 4,933
  • 6
  • 34
  • 58
11
votes
2 answers

Only decompress a specific bzip2 block

Say I have a bzip2 file (over 5GB), and I want to decompress only block #x, because there is where my data is (block is different every time). How would I do this? I thought about making an index of where all the blocks are, then cut the block I…
user163365
  • 1,317
  • 9
  • 14
10
votes
2 answers

How to compress a directory with libbz2 in C++

I need to create a tarball of a directory and then compress it with bz2 in C++. Is there any decent tutorial on using libtar and libbz2?
zajcev
10
votes
5 answers

Bz2 every file in a dir

I am running centos and I have around 1,300 files in a folder that each need to be bzipped individually. What would be the easiest way of handing this?
Steven Kull
  • 141
  • 1
  • 2
  • 7
10
votes
2 answers

Is it possible to parallelize bz2's decompression?

I am using pythons bz2 module to generate (and compress) a large jsonl file (bzip2 compressed 17GB). However, when I later try to decompress it using pbzip2 it only seems to use one CPU-core for decompression, which is quite slow. When i compress it…
worenga
  • 5,776
  • 2
  • 28
  • 50
10
votes
2 answers

Migrate Java decryption code to Golang

I'm struggling with the migration of Java code to Golang for the last few days and I am now stuck. This is the working Java code: final Key k = new SecretKeySpec(keyString.getBytes(), "AES"); Cipher c =…
fasmat
  • 3,353
  • 1
  • 15
  • 13
9
votes
4 answers

Possible to combine several bz2 archives into one?

I have several (27) huge (several GB each) bz2 archive files that I need combined into one bz2 archive. Uncompressing them and then creating a new archive from what was just uncompressed is not an option for me, since compressed, all 27 files add…
dmn
  • 965
  • 3
  • 13
  • 24
8
votes
4 answers

How do the compression codecs work in Python?

I'm querying a database and archiving the results using Python, and I'm trying to compress the data as I write it to the log files. I'm having some problems with it, though. My code looks like this: log_file = codecs.open(archive_file, 'w',…
Chris B.
  • 85,731
  • 25
  • 98
  • 139
8
votes
2 answers

ROS - Compilation fails due to Bzip2 libraries

I'm trying to compile a package using Ros Indigo. I'm using a Raspberry Pi running Raspbian. The BZIP2_LIBRARIES BZIP2_INCLUDE_DIR are missing. When I run the make command, I get the following error: -- +++ processing catkin package:…
UserK
  • 884
  • 3
  • 17
  • 40
7
votes
2 answers

Java: Bzip2 library

I need to create Bzip2 archive. A downloaded bzip2 library from 'Apache ant'. I use class CBZip2OutputStream: String s = ..... CBZip2OutputStream os = new CBZip2OutputStream(fos); os.write(s.getBytes(Charset.forName("UTF-8"))); …
Alex
  • 91
  • 1
  • 3
7
votes
2 answers

bzip2: Input file file.txt has 1 other link

When calling bzip2 file.txt I get this error message bzip2: Input file file.txt has 1 other link I'm using OSX, but I think this problem is not specific to OSX, so I'm asking here.
Matthias M
  • 12,906
  • 17
  • 87
  • 116
7
votes
1 answer

BZip2 compressed input for Apache Flink

I have a wikipedia dump compressed with bzip2 (downloaded from http://dumps.wikimedia.org/enwiki/), but I don't want to unpack it: I want to process it while decompressing on the fly. I know that it's possible to do it in plain Java (see e.g. Java…
Alexey Grigorev
  • 2,415
  • 28
  • 47
7
votes
1 answer

How to manually pass source of bzip2 install for Python install?

I've been through several StackOverflow questions about Python & bzip2. These have been very helpful in getting me to the state I'm clearly at now. Here's what I've done so far and the problem I'm having: I do not have root access and cannot…
stevenhaddox
  • 1,185
  • 1
  • 13
  • 22
6
votes
2 answers

How to read compressed bz2 (bzip2) Wikipedia dumps into stream xml record reader for hadoop map reduce

I am working on using Hadoop Map Reduce to do research on the wikipedia data dumps (compressed in bz2 format). Since these dumps are so big (5 T), I can't decompress the xml data into HDFS and just use the StreamXmlRecordReader that hadoop provides.…
Laurel Orr
  • 61
  • 1
  • 2
1
2
3
21 22