Cezary Wagner <cezary.wag...@gmail.com> added the comment:
I do some test on linux all works - changes are detected and os.scandir() works but in Windows not - probably there is not unit test which check if os.scandir() is working on open files for writing. f.flush() no matter since file can be changed in external Python/Java/C#/C++, ... application - anyone can write logs in Windows. I will explain it in next comment. I just write this code to show only problem. Result from linux STAT = False so only repeat os.scandir() calls. Modification are detected correctly in Linux but not in Windows. [wagnecaz@nsdptrms01 ~]$ python3 s03_dir_entry.py dir_entry.stat() /home/wagnecaz/test.txt 1593085189.1000397 since last change 0.001112222671508789 2020-06-25 13:39:49.101368 1593085189.101368 dir_entry.stat() /home/wagnecaz/test.txt 1593085189.1000397 since last change 1.0028572082519531 2020-06-25 13:39:50.103111 1593085190.103111 dir_entry.stat() /home/wagnecaz/test.txt 1593085190.1020408 since last change 1.0026073455810547 2020-06-25 13:39:51.104881 1593085191.104881 dir_entry.stat() /home/wagnecaz/test.txt 1593085191.104042 since last change 1.0023958683013916 2020-06-25 13:39:52.106793 1593085192.106793 dir_entry.stat() /home/wagnecaz/test.txt 1593085192.106043 since last change 1.0023260116577148 2020-06-25 13:39:53.108582 1593085193.108582 dir_entry.stat() /home/wagnecaz/test.txt 1593085193.1080444 since last change 1.0021436214447021 2020-06-25 13:39:54.110500 1593085194.1105 dir_entry.stat() /home/wagnecaz/test.txt 1593085194.1100454 since last change 1.0013866424560547 2020-06-25 13:39:55.111684 1593085195.111684 dir_entry.stat() /home/wagnecaz/test.txt 1593085195.1110466 since last change 1.0022354125976562 2020-06-25 13:39:56.113542 1593085196.113542 dir_entry.stat() /home/wagnecaz/test.txt 1593085196.1130476 since last change 1.0021603107452393 2020-06-25 13:39:57.115450 1593085197.11545 dir_entry.stat() /home/wagnecaz/test.txt 1593085197.1140487 since last change 1.003014326095581 Change is done every 1s and detected in Linux in Windows it is stalled. 2020-06-25 13:39:58.117287 1593085198.117287 dir_entry.stat() /home/wagnecaz/test.txt 1593085198.11605 since last change 1.002938985824585 2020-06-25 13:39:59.119224 1593085199.119224 dir_entry.stat() /home/wagnecaz/test.txt 1593085199.118051 since last change 1.0027978420257568 2020-06-25 13:40:00.121166 1593085200.121166 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41106> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com