|< 1 2 3 >| | 23 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
my $mtime;
my $line;
my $data;
#auf $data kann man getrost zugreifen mtime hat sich nicht geaendert
if(($mtime == (stat("file.dat"))[9]) && (defined($mtime))) {
#.... Verarbeitung von $data
#erstes mal einlesen oder mtime hat sich geaendert
} else {
$data = '';
open(FILE, "< file.dat");
while($line = <FILE>) {
$data .= $line;
}
close(FILE);
$mtime = (stat("file.dat"))[9];
}
QuoteLinux is renowned for its fast disk access and this is mainly because of its efficient implementation of the buffer cache. The buffer cache rose and shrinks dynamically in user memory as required. (Actually, kernel memory grows dynamically into user memory to allow this - the buffer cache is still considered part of kernel memory.)
|< 1 2 3 >| | 23 Einträge, 3 Seiten |