Simpler solution
Raj J, October 25, 2016 - 5:48 pm UTC
As soon as a file is available, (your) processes can rename it (by appending timestamp to it) and possibly move it to a different directory. And only then you process it from its new location using the new name. This should work in most cases.
October 26, 2016 - 12:57 am UTC
Nice input.
A technique I've seen used in the past is
File reading process
====================
- writes empty file, eg, 'filename.wip' ("work in progress")
- then reads filename.dat
- erases filename.wip
File writing process
====================
while true
if fileexists filename.wip then sleep 5
end while
write filename.dat
Its not perfect, but does a reasonable job and ensuring no collisions
A reader, October 26, 2016 - 4:29 am UTC
Very good solution of indicator file to seperate read and write