#!/usr/bin/perl use strict; # filetimestamp.pl # start this just after psiblast my( $file, $i, $newtime, $lasttime, $round, $t, $middl, $length ); #$file = $ARGV[0]; $file = "pax6.matt"; $lasttime=0; $middl = 0; $round = 0; $length = 0; for ($t=0;$t<2400;$t++) { # 2400*5sec=200min $newtime = (stat($file))[9]; if ($newtime ne $lasttime) { # mittelwert berechnen (statistic ist ihr Programm zur Mittelwertberechnung einer Spalte eines files), z.B. $middl = 0; $length = 0; if($round == 0) { open(TF, ">aenderungpax6.txt") || die ("Die Ausgabedatei kann nicht erstellt werden!\n"); } else { open(TF, ">>aenderungpax6.txt") || die ("FEHLER beim anhängen an die Ausgabedatei!\n"); } open(MAT, "<$file") || print "$file kann nicht gelesen werden!\n"; while() { &auswertung($_); } close(MAT); if($length > 0) { $middl = $middl/$length; print TF "$round $middl\n"; } #system("echo -n $round >> notes; echo -n '\t' >> notes; statistic pax6.mat 43 | average >> notes"); close(TF); $lasttime=$newtime; $round++; } sleep(1); } #Funktionen sub auswertung() { my($zeile) = @_; if($zeile =~ /^\s+\d+\w/) { $zeile =~ /.*(\d.\d\d)\s+\d.\d\d/; $middl += $1; $length++; } }