In Lion, this script always shows a diagnosticCount = 1 , indicating that the file has completed writing BEFORE it is available for reading.
In Mt Lion, this script shows a diagnosticCount = 2, 3 or 4 , indicating that the file was being written AFTER the file is available for reading.
The procedure in Lion is standard for any OS. The results for Mt Lion indicate that a serious bug has been introduced into the OS.
This brings to mind a variation on a theme of a monkey at a typewriter. Could a monkey at a typewriter, given a copy of Shakespeare's Hamlet, edit it and would it be an improvement?
I think I will wait for the release of 10.8.3 before testing again. Perhaps some of the flakiness in 10.8.2 will be fixed.