# HG changeset patch # User Henry S. Thompson # Date 1619127063 0 # Node ID f148c2366faa686a624c71e2dc05cabe3b3e30db # Parent 15abf4aab3070c0a7f744b22c021ac368133da25 back to IGzipFile diff -r 15abf4aab307 -r f148c2366faa bin/ix.py --- a/bin/ix.py Thu Apr 22 21:10:02 2021 +0000 +++ b/bin/ix.py Thu Apr 22 21:31:03 2021 +0000 @@ -9,8 +9,8 @@ Note that if no output flag(s) is/are given, the whole WARC record will be output, more efficiently than would be the case if -whb is given.''' import sys, argparse, regex, os, shutil, io, gzip, time -#from isal import igzip -from subprocess import Popen, PIPE +from isal import igzip +#from subprocess import Popen, PIPE #import asyncio HACK_USAGE=regex.compile('\[-x\]\n\s*\[length\] \[offset\] \[filename\]') @@ -50,19 +50,9 @@ if options.zipped: BINOUT.write(bv) else: - #gzip_chunk = io.BytesIO(bv) + gzip_chunk = io.BytesIO(bv) uv=memoryview(buf)[length:] #clear_bytes=io.BytesIO(uv) - p = Popen(["/lustre/home/dc007/hst/gentoo/usr/bin/igzip", - "-dc"], - stdin=PIPE, - stdout=None) - fout, ferr = p.communicate(bv) - res=p.wait() - if res!=0: - print('pipe failed',res,ferr.decode()) - exit(2) - return with igzip.IGzipFile(fileobj=gzip_chunk) as gzip_fin: while True: l=gzip_fin.readinto(uv)