+sub new { bless { watch => {}, dirlist => {} }, __PACKAGE__ }
+
+sub fill_dirlist ($$$) {
+ my ($self, $path, $dh) = @_;
+ my $dirlist = $self->{dirlist}->{$path} = {};
+ while (defined(my $n = readdir($dh))) {
+ $dirlist->{$n} = undef if $n !~ /\A\.\.?\z/;
+ }
+}