Listing 1

 1 #!/usr/bin/perl
 2 # atchange 
 3
 4
 5 $file = $ARGV[0];
 6 $command = $ARGV[1];
 7
 8 @file = stat($file);
 9 $date = $file[7];
10
11 while (){
12  @file = stat($file);
13  $update = $file[7];
14  sleep 1;
15  if ( $update ne $date ){
16        $date = $update;
17        system(„$command“);
18  }
19 }

Vi editor WYSIWYG?

BYTE România - ianuarie 1998


(C) Copyright Computer Press Agora