$inpfsz = 0; open(RESFIL, ">$desfnm"); binmode(RESFIL); while ($inpcnt=read($srcfnm,$inpbuf,2096)) { $inpfsz += $inpcnt; print RESFIL $inpbuf; } close(RESFIL);