9 our $dir = "$server::base_dir/log";
10 mkdir $dir unless -e $dir;
12 foreach ( glob("$dir/pxelator.*.log") ) {
13 warn "unlink $_ ", -s $_;
17 my $mac_dir = "$dir/mac";
18 mkdir $mac_dir unless -e $mac_dir;
20 use Time::HiRes qw/time/;
24 my ( $mac, $message ) = @_;
25 print "MAC $mac $message\n";
26 open(my $fh, '>>', "$mac_dir/$mac");
27 print $fh time() - $start_t, "\t$message\n";
40 foreach my $mac_path ( sort glob("$mac_dir/*") ) {
42 open(my $fh, '<', $mac_path);
45 $pos =~ s{/([^/]+$)}{/\.$1\.pos};
47 $mac =~ s{(..)}{$1:}g;
49 seek $fh, read_file($pos), 0 if -e $pos;
53 push @changes, "$_\t$mac";
56 warn "pos $pos ",tell($fh) if $server::debug;
57 write_file $pos, tell($fh);