I am using obs to sequentially record many mp4 files. They are stored in a directory under a naming convention of clip_{n}.mp4. A ruby program detects the files in the directory and lists them for the user. However, the second you hit record in obs, the file is already created while it is still being written. So the ruby program detects and incomplete file to list to the user. I am looking for a way to exclude this incomplete file until obs is finished recording and saving the clip. I gave tried using system %Q[lsof #{file_path}] but it is quite slow. Is there any better way to detect an "incomplete" file?