Generalize file copy length to long instead of int