Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Race condition in Linux::Inotify2 between dir and new file?

by Crackers2 (Parson)
on Jun 25, 2009 at 03:23 UTC ( #774579=note: print w/replies, xml ) Need Help??

in reply to Race condition in Linux::Inotify2 between dir and new file?

Wouldn't you be better off using the IN_CLOSE_WRITE and IN_MOVED_TO events?

IN_CREATE sounds to me like it fires when the file gets created, i.e. at open time, while it seems you're more interested in knowing when the file contents are fully there.

IN_CLOSE_WRITE sounds like it would take care of this for you for new files that get created in the watched directory (which I assume also covers a copy), while IN_MOVED_TO would take care of existing files that get added to the directory (either through move or link)

(Big disclaimer: I haven't used inotify myself, I'm just speculating based on gut instinct and the docs)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://774579]
[stevieb]: I don't know what you mean. I write the code in C/C++ that accesses the ICs per the datasheet, wrap it for Perl, then use them. My code ensures that the functions/methods from Perl do the right thing for the chips/sensors etc
[stevieb]: At least that's what I'm working on right now. I've also been updating my automated test software Test::BrewBuild so it handles this work properly. It's not really easy meshing high level languages with low-level hardware :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-06-25 23:08 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.