jmurphy has asked for the wisdom of the Perl Monks concerning the following question:
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,
Jay
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I test to see if another process is writing to a file (in Windows) (!share)
by tye (Sage) on Sep 25, 2007 at 06:16 UTC | |
by jmurphy (Acolyte) on Sep 25, 2007 at 07:37 UTC | |
by tye (Sage) on Sep 25, 2007 at 07:46 UTC | |
by goibhniu (Hermit) on Sep 27, 2007 at 15:47 UTC | |
Re: How do I test to see if another process is writing to a file (in Windows)
by mr_mischief (Monsignor) on Sep 25, 2007 at 05:50 UTC | |
Re: How do I test to see if another process is writing to a file (in Windows)
by blahblahblah (Priest) on Sep 25, 2007 at 23:34 UTC | |
by tye (Sage) on Sep 26, 2007 at 14:56 UTC |