分割合并文件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

use strict;
my $ItemSize = 1024 * 1024 * 100;
open(FILEHANDLE, "< a1.mkv");
binmode   FILEHANDLE;
seek(FILEHANDLE,0,2);
print "file size is " . tell(FILEHANDLE) . "\n" ;
my $fileNum = tell(FILEHANDLE) / $ItemSize;
seek(FILEHANDLE,0,0);
print "file pos is " . tell(FILEHANDLE) . "\n" ;
# my $len = read(FILEHANDLE,my $FileCon, 12);
# print $len;
for(my $i = 0; $i <$fileNum; $i++) {
 my $FileCon;
 open(TEMPFILEHANDLE, "+>", "$i" . "\.DATA");
 binmode TEMPFILEHANDLE;
 my $ContRead = read(FILEHANDLE, $FileCon,$ItemSize);
 print $ContRead . "\n";
 print "file pos is " . tell(FILEHANDLE) . "\n" ;
 print TEMPFILEHANDLE $FileCon;
 if ( $ContRead < $ItemSize) {
  $ContRead = read(FILEHANDLE, $FileCon, $ItemSize -  $ContRead);
  print $ContRead . "\n";
  print TEMPFILEHANDLE $FileCon;
 }
 
 close(TEMPFILEHANDLE);
}

close(FILEHANDLE);