################################################################# sub inotifywait { ################################################################# my $self = shift; ### Forces a flush after every write to this pipe. $|++; ### Make a list of exclude patterns using contents of skip file. my $exclude = join ' --exclude=', '', @{$self->{patterns}}; ### Put inotifywait command together. my $cmd = '/usr/local/bin/inotifywait -mrqc ' . $exclude . ' --fromfile=' . $self->{bdir} . '/list -e close_write,delete |'; $self->debug(qq{$cmd\n}); $pid = open INOTIFY, $cmd or die $!; while (my $output = ) { chomp $output; $q->enqueue($output); $self->debug(qq{IN inotifywait thread.\n}); $self->debug("Items in queue: " . scalar $q->pending() . "\n"); } }