I think this is not a sure way to check that a file is not being written to though, say, an FTP process might have stalled, or a long running process that hasn't flushed its file handle yet...
To reliably check for the completion of a file, I think it is necessary to introduce some trigger files, or to have the process that creates the file to write to a different extension first, and then rename it to the matching extension.