Leser: 2
![]() |
|< 1 2 3 4 >| | ![]() |
34 Einträge, 4 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
use warnings;
use strict;
use constant TRUE => 1;
use constant FALSE => 0;
use Linux::Inotify2;
use IO::Handle;
open my $fh, '<', $ARGV[0] or die "Cannot open file: $!\n";
$fh->blocking( FALSE );
my $inotify = new Linux::Inotify2 or die "Unable to creat Linux::Inotify2 object: $!\n";
$inotify->watch( $ARGV[0], IN_MODIFY, \&file_changed ) or die "watch creation failed";
sub file_changed {
while ( sysread $fh, my $buff, 50 ) {
syswrite STDOUT, $buff;
}
}
print <$fh>;
1 while $inotify->read;
close $fh;
![]() |
|< 1 2 3 4 >| | ![]() |
34 Einträge, 4 Seiten |