title: PHP - Will fwrite() save the file immediately?
body: <p>This is my code:</p>
  
  <pre><code>$zplHandle = fopen($target_file,'w');
  fwrite($zplHandle, $zplBlock01);
  fwrite($zplHandle, $zplBlock02);
  fwrite($zplHandle, $zplBlock03);
  fclose($zplHandle);
  </code></pre>
  
  <p>When will the file be saved? Is it immediately after writing to it or after closing it?</p>
  
  <p>I am asking this because I have <a href="http://www.printfil.com/" rel="noreferrer">Printfil</a> listening to files in a folder and prints any file that is newly created. If PHP commits a save immediately after <code>fwrite</code>, I may run into issues of Printfil not capturing the subsequent writes.</p>
  
  <p>Thank you for the help.</p>