I have a python script that processes a file. Currently I manually start the python script when the file is generated. What I want is that my python script is constantly running and checking for the existence of the file. There are a lot of examples how to achieve that: Python while loop to check if file exists Check and wait until a file exists to read it Python (Watchdog) - Waiting for file to be created correctly
but my file is about ~10GB, so when the file is generated but not finished with the generation, my python will already see it existence and will process the file while it is still being generated.
Any tips?
What I probably could do is, when the file exists, go into another loop which checks its size/checksum and if the size/checksum doesn't change, it means the file is completely generated.