in reply to file locking

If you have control of the other scripts you can implement a scenario like this

when 1 file writes create a .lck.filename - have all files check for that file before writing - have the controlling script remove the .lck.filename. Its not a perfect scenario, but Ive run into it before.

Ted
--
"Men have become the tools of their tools."
  --Henry David Thoreau