title: Will Python open a file before it's finished writing?
body: <p>I am writing a script that will be polling a directory looking for new files. </p>
  
  <p>In this scenario, is it necessary to do some sort of error checking to make sure the files are completely written prior to accessing them?  </p>
  
  <p>I don't want to work with a file before it has been written completely to disk, but because the info I want from the file is near the beginning, it seems like it could be possible to pull the data I need without realizing the file isn't done being written.</p>
  
  <p>Is that something I should worry about, or will the file be locked because the OS is writing to the hard drive?</p>
  
  <p>This is on a Linux system.</p>