switches temp file to binmode, fixes gzip path