Read bzip files


















Otherwise the output buffer will be cleared before any uncompressed data is written to it. If Append is enabled, the file will be opened in append mode. Otherwise the contents of the file, if any, will be truncated before any uncompressed data is written to it. If Append is enabled, the filehandle will be positioned to the end of the file via a call to seek before any uncompressed data is written to it.

Otherwise the file pointer will not be moved. When Append is specified, and set to true, it will append all uncompressed data to the output data stream. So when the output is a filehandle it will carry out a seek to the eof before writing any uncompressed data.

If the output is a filename, it will be opened for appending. If the output is a buffer, all uncompressed data will be appended to the existing buffer. Conversely when Append is not specified, or it is present and is set to false, it will operate as follows. When the output is a filename, it will truncate the contents of the file before writing any uncompressed data.

If the output is a filehandle its position will not be changed. If the output is a buffer, it will be wiped before any uncompressed data is output. Returns the data, if any, that is present immediately after the compressed data stream once uncompression is complete. This option can be used when there is useful information immediately following the compressed data stream, and you don't know the length of the compressed data stream.

If the input is a buffer, trailingData will return everything from the end of the compressed data stream to the end of the buffer.

Save my name, email, and website in this browser for the next time I comment. Notify me of followup comments via e-mail. You can also subscribe without commenting. This site uses Akismet to reduce spam. Learn how your comment data is processed. If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? Related Posts.

Tomek The flag -v means verbose mode, where the compression ratio of each file is processed and displayed to the user. I believe it is most efficient in compressing text since it works by grouping characters that appear frequently together. Just to test the format out, I did a little unscientific comparison between bzip2 and a couple popular compression format.

I took a random text file my bash history file and compressed it using bzip2, tar with gzip compression and zip. If the file is a straight bz2 file with a file extension like filename. The simples way to decompress it is using bunzip2.

Bunzip2 is an alias for bzip2 -d. The tar utility actually has bzip2 support. When tar determines the file is a bzip2 file it will call bzip2 before untaring the file. So in many cases the file will have been compressed using tar. In that case, the file extension is most likely tar. In this case it would be much more effecient to use the tar command. Otherwise you would only get a. The command for that would be:. If you need to create a bz2 file, the quick way to do it is just run bzip2 whith the -z option:.

However this will delete the original file like filename. This might not be what you want to do. To keep the original file you should use the -k option as well. Email Required, but never shown. The Overflow Blog. Podcast Helping communities build their own LTE networks. Podcast Making Agile work for data science. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions.



0コメント

  • 1000 / 1000