good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: how to tell if a file is still being modifiedby halley (Prior) |
on Sep 15, 2003 at 19:45 UTC ( [id://291637]=note: print w/replies, xml ) | Need Help?? |
No easy way. No portable way. Your method is about as good as I've found, if you can't otherwise ask the OS about open files. Things like lsof on Linux may help, but only on the same machine which is actually regulating the filesystem; I can imagine certain network filesystems like Samba or NFS hiding those details. I made a quickie script I call 'settle' which runs a shell command repeatedly until the standard output or a given file ceases to change. It offers a variable window for polling for changes, but defaults to 5sec. --
In Section
Seekers of Perl Wisdom
|
|