Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: File Watching in Windows

by sgt (Deacon)
on Sep 11, 2007 at 13:19 UTC ( #638293=note: print w/replies, xml ) Need Help??

in reply to File Watching in Windows

Well you are describing a "broken" interface (to call it something). You cannot guarantee the copy will be ok. Imagine the other side writes to the file in chunks of 10k every twenty minutes for ...

On the pragmatic side, the idea is simple, check the length of the file every x seconds, copy when it hasn't changed in the last n checks (y = n * x); choose n wisely ;)

Actually on my to_do list is to check File::Monitor; might be useful to you.

While writing this it occurs to me a variation: have the previous check of the size done by a child process, and have the child change the name to *.ok. In the main program just copy the *ok.

cheers --stephan

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://638293]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2023-03-24 04:16 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.