title: Python: get the list of files in a directory
body: <p>I have a program in Python (Python 3 on Ubuntu 16.04) that checks for new files in a directory (<code>.mp4</code> files are the result of segmenting a live video stream). I use <code>os.listdir(path)</code> to get the new files in my iterations. The problem is that when a new <code>.mp4</code> file is created, first an empty file is created while the contents are being appended incrementally, so the file is not yet finalized/finished/playable (usually if you look at a folder, these files are shown like no extension). </p>
  
  <p>Is it possible to ignore such non-finalized files at the Python level when getting the list of files in directory? Maybe some functions or API exists for that?</p>