![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
How do I test to see if another process is writing to a file (in Windows)by jmurphy (Acolyte) |
on Sep 25, 2007 at 04:36 UTC ( #640856=perlquestion: print w/replies, xml ) | Need Help?? |
jmurphy has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm racking my tiny brain and shockingly still can't come up with an elegant solution for the following problem: Is it possible to determine whether an external process is writing to file on Windows? I'm writing a Perl application that polls the file system. It looks for files with a certain extension (.log) and if it finds one it takes action. However, it shouldn't take action until the external application has finished writing the log file. Therefore the polling application needs to check and see of the external process is still writing to the file. Is there an easy way to do this? I've read the archives and I see that some people have used stat in order to check for changes in the size and/or modified date of a file. However, this seems so primitive. Any elegant solutions out there?
Thanks so much,
Back to
Seekers of Perl Wisdom
|
|