I think it'd be very convenient if drat-trim could handle both .cnf.gz and .drup.gz files. A possibility would be to try and spawn gunzip -k --stdout the_file.{cnf,drup}.gz and read from the file descriptor, to not even have to depend on zlib at all.