Apr-14-2021, 10:01 AM
I have a programme that writes an mtx file to a specified directory on my laptop. It's a very large file (~400,000 KB) and so takes quite some time to finish being written. The next block in my code is dependent on the mtx file being fully written but proceeds to execute once the mtx file first appears in the directory. I had used:
between the two blocks to ensure the file was fully written, but I want a more robust way of checking as this sleep time may not always work. Any ideas on how to check that the file has finished being written? I've had a look at the watchdog module but I can't wrap my head around the syntax. Thank you.
1 |
time.sleep( 120 ) |