How to know whether a file is completely written using PHP?
<p>I am writing a SQL query results to a file and once I am done writing it to a file I need to output the file to user for download. My Question is how do i know when the file is completely written as different SQL query takes different amount of time. Is there anyway I can know that a file is completely written  using PHP ?</p>
