简体   繁体   中英

How to most efficiently detect file add/delete/rename changes of a directory in Python?

如果我有一个表格,表示目录A中文件/子目录的路径和大小,我如何在目录A中递归检测更改,以便我可以有效地更新我的表?

I use watchdog , which is a python library for just this kind of thing. If you want to know how they're doing it, you can dive into the source code of the project.

如果你在linux上运行使用pyinotify

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM