Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Race condition in Linux::Inotify2 between dir and new file?by Your Mother (Archbishop) |
on Jun 24, 2009 at 22:06 UTC ( [id://774531]=perlquestion: print w/replies, xml ) | Need Help?? |
Your Mother has asked for the wisdom of the Perl Monks concerning the following question: I'm getting a race condition in some Linux::Inotify2 code. Where I'm watching a directory for IN_CREATE events to process the created files. The following works perfectly 99% of the time.
But then bam-
The file is there and in tact by the time I can manually check of course but XML::LibXML tried to read it too early. This means it passed the -f but had no content, I think. Among several other dead-ends, like playing with the cookie and watch args, I tried this-
-in a misguided attempt to move the event check to the file, but of course this could only succeed in the 1 in 100 case where the race condition hits. What am I missing or doing wrong? Thank you!
Back to
Seekers of Perl Wisdom
|
|