It is necessary to catch the event of deleting (creating) a file. The first idea is to write a program that cyclically checks the files in the directory. But it seems to me that it is too expensive with respect to computing resources. I think there is no other way to catch events?
Or will there be nothing terrible if an additional small process falls on the processor? If so, then will the fact that a program in python ( java ) be hit hard or is it better to use it с++ ?
- ReadDirectoryChangesW - Alexander Petrov
- @Alexander Petrov Maybe WaitForSingleObject (or WaitForSingleObjectEx)? - Alex Titov
- ru.stackoverflow.com/questions/538673/… - MaxU
|
1 answer
You just need to calculate the number of files in the directory (this should be done periodically, checking the difference between the values). And how to calculate the number of files, I found the answer on another site: http://qaru.site/ questions /59598/how-to-count-the-number-of-files-in-a-directory-using-python
|