pythonhookpydbgevent-hooking

hook file creation in python


I'm working on a program, where in some part of it, it needs to listen to the OP for when files are created/saved, so I can work on said file. I know the basic concept of hooking, but I don't know exactly how to implement it in this specific use(I know how to attach a hook to a specific PID, but here I need to listen to all processes and see if one of them is creating a file). I'm using pydbg for my hooking needs, but if your answer uses something different, feel free to still answer. Thanks :)


Solution

  • It seems you need something like watchdog, pyinotify or python-inotify. You can also see this SO question for other options.