in reply to Race condition in Linux::Inotify2 between dir and new file?
sub process_drop_file { my $file = Path::Class::File->new(shift); -f $file or croak "'$file' is not a file"; sleep(1) until (-s $file); # <-- New line my $doc = XML::LibXML->new->parse_file("$file"); # Do stuff with it... $file->remove or croak "Couldn't remove '$file'"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Race condition in Linux::Inotify2 between dir and new file?
by Your Mother (Archbishop) on Jun 24, 2009 at 23:02 UTC | |
|
Re^2: Race condition in Linux::Inotify2 between dir and new file?
by spx2 (Deacon) on Jun 25, 2009 at 09:29 UTC |