I searched how to compress a file in python, and found an answer that was basically as described below:
with open(input_file, 'rb') as f_in, gzip.open(output_file, 'wb') as f_out:
f_out.write(f_in.read())
It works readily with a 1GB file. But I plan on compressing files up to 200 GB.
Are there any considerations I need to take into account? Is there a different way I should be doing it with large files like that?
The files are binary .img files (exports of a block device; usually with empty space at the end, thus the compression works wonderfully).