smart handling of gzip files