简体   繁体   English

Pyinotify-目录重命名后从原始路径引发的事件

[英]Pyinotify — event raised from original path after directory renaming

I use pyinotify to monitor my file system. 我使用pyinotify监视我的文件系统。 The problem is when I rename a directory and create file in the renamed directory, the event is raised from original path(referred by event.name ). 问题是当我重命名目录并在重命名的目录中创建文件时,该事件从原始路径引发(由event.name )。 Can't figure out what is wrong? 不知道出什么问题了吗? Any problem with the add_watch flag when initializing the watcher? 初始化观察程序时, add_watch标志有问题吗? Currently the flag is set as rec=True, auto_add=True . 当前标志设置为rec=True, auto_add=True

Thanks and best regards. 谢谢和最好的问候。

You need to add the IN_MOVE_SELF event to your mask. 您需要将IN_MOVE_SELF事件添加到蒙版中。

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 来自外部创建文件的python pyinotify事件 - python pyinotify event from externally created file 通知已处理事件的返回值 - pyinotify return value from handled event 使用pyinotify在目录中创建假脱机的最佳方法是什么? - What is the best way to make a spool in a directory with pyinotify? 重命名文件后出现“FileNotFoundError:没有这样的文件或目录” - 'FileNotFoundError: No such file or directory' after renaming files 即使在 pip 安装后 ImportError (pyinotify) - ImportError even after pip install (pyinotify) 从数据框中重命名目录中的文件 - Renaming files in a directory from a data frame 如何将带有模块的目录导入到Python路径,该路径是从子文件夹到原始源的符号链接? - How to import a directory with modules to Python path that is a symlink to original source from a subfolder? 文件出现在目录中的速度比我处理它们的速度快(pyinotify) - Files appearing in directory faster than I can process them (pyinotify) 在使用TreeView之后,从.get_model()和.get_path()获取原始行号 - Get original row number from .get_model() and .get_path() after TreeView was resorted 递归pyinotify监视停止删除子目录 - Recursive pyinotify watch stops sub-directories from being removed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM