my two bits worth of pragmatic approach, and something that a complex software i worked on did, is to check the input file is readable, and safely check that the executable exists and is executable. in other words, more checking up front instead of code to pick up the pieces. the code to "pick up the pieces" should exist anyway but for the whole script, in the event of truly unforseen circumstances.
if the input files have a fleeting existence, or just to be sure, copy it to your own temp file first.
i'm sure you already considered and discounted the use of the compression/uncompression module, which would get away from using an external executable in the first place.
the hardest line to type correctly is: stty erase ^H