use strict; my $diafile="RT_4.dia"; open(FDIA, $diafile) or die "cannot open $diafile"; my @s = stat($diafile); print "Dateigroesse ",$s[7]," Bytes\n"; my $rec; my $totlen=0; my $template = "d"; my $len = length pack($template,0.); while (1) { my $res=read(FDIA,$rec,$len); if (!defined($res)) {print $totlen," error"; last;}; if ($res==0) {print "OK\n"; last;}; if ($res<$len) {print $res,"<",$len," length_read=",$totlen+$res; last;}; $totlen+=$len; }