The best way to do it would be to arrange for the various processes to talk to one another. On some systems, it might be possible to request exclusive write-access to the file as a way of making sure that no one else is writing to it ... but on other systems, where locking is only “advisory,” that won’t work. There is no “generalized” solution to this sort of objective. You will need to understand both the readers and the writers very well. Again, by far the best way to do it is to arrange for the writers to inform you when they have finished writing a particular file: don’t rely upon notifications, but instead arrange for the writers to write filenames to a pipe or queue that the next-stage process(es) will be reading. Otherwise, you will always be dealing with race conditions, obliging you to try to minimize their effect. (They will still race, and fail, and they will inevitably do it at 2:30 AM when you’ve got the pager ...)