Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: File Watching in Windows

by sgt (Deacon)
on Sep 11, 2007 at 13:19 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-29 06:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found