File: gzipwrite128kblocks.py

package info (click to toggle)
python-isal 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,796 kB
  • sloc: python: 3,190; ansic: 2,952; makefile: 17
file content (12 lines) | stat: -rw-r--r-- 288 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import os
import sys

from isal import igzip

with open(sys.argv[1], "rb") as in_file:
    with igzip.open(os.devnull, "wb") as out_gzip:
        while True:
            block = in_file.read(128 * 1024)
            if block == b"":
                break
            out_gzip.write(block)