P
Philipp Pagel
Hi Pythoneers,
I need to process a large number of files which have been packed by the
UNIX compress tool (*.Z files). As I am not aware of a compress
equivalent of the gzip, zipfile or bzip2 modules, I thought I'd use the
uncompress or zcat commands directly to deal with the files:
for filename in file_list:
file = os.popen('uncompress -c '+filename, 'r')
do_something(file)
file.close()
This works fine for some files but results in
'write error onstdout: Broken pipe'
emitted by uncompress for others. Using zcat instead of uncompress
changes the wording of the error message but not the result.
I tried to give popen a large bufsize argument but that didn't really
help.
Probably I'm overlooking something obvious here but right now I can't
see it. Any hints?
cu
Philipp
I need to process a large number of files which have been packed by the
UNIX compress tool (*.Z files). As I am not aware of a compress
equivalent of the gzip, zipfile or bzip2 modules, I thought I'd use the
uncompress or zcat commands directly to deal with the files:
for filename in file_list:
file = os.popen('uncompress -c '+filename, 'r')
do_something(file)
file.close()
This works fine for some files but results in
'write error onstdout: Broken pipe'
emitted by uncompress for others. Using zcat instead of uncompress
changes the wording of the error message but not the result.
I tried to give popen a large bufsize argument but that didn't really
help.
Probably I'm overlooking something obvious here but right now I can't
see it. Any hints?
cu
Philipp