- my ($self, $path, $mask, $cb) = @_;
- open(my $fh, '<', $path) or return;
+ my ($self, $path, $mask) = @_;
+ my ($fh, $watch);
+ if (-d $path) {
+ opendir($fh, $path) or return;
+ my @st = stat($fh);
+ $watch = bless [ $fh, $path, $st[10] ],
+ 'PublicInbox::KQNotify::Watchdir';
+ } else {
+ open($fh, '<', $path) or return;
+ $watch = bless [ $fh, $path ],
+ 'PublicInbox::KQNotify::Watch';
+ }