Allow a mode where the files are created with a .tmp extension then when closing the file, rename to the intended name. This will allow the file **input** to consume (and delete) the file in read mode.