What does the 65536 indicate here? i got this off some site and am trying to understand how this works since i need to write a similar function to copy using bin mode. Update:I actually want to make this code to copy files in binary mode.Any ideas to help me on my mission?#!/usr/bin/perl # copy a file $in = "postcodes"; $out = "pc.bak"; open (IN,$in); open (OUT,">$out"); print OUT $buffer while (read (IN,$buffer,65536));
File::copy says that file would be opened in bin mode where applicable.The issue is that the font files that I am trying to copy are often not copied properly and the copied files are smaller than the original file.#!usr/bin/perl use strict; use File::Find; use File::Copy; my @location=("C:\\Documents and Settings\\smanicka\\Desktop\\JAVA","C +:\\Documents and Settings\\smanicka\\Desktop\\excel files-new"); my $new_location="C:\\moved_files"; foreach my $location(@location){ find(\&force_move,$location); } sub force_move(){ my $file=$_; print "\n $file"; copy($file,$new_location) or warn "$!" ; } print "I am done!!!!"; sleep(2);
In reply to bin mode file copy by smanicka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |