Pyinotify module can monitor folder??

Pyinotify module can monitor folder?? I set the control path path = " /usr/local/etc/" you can do it, but is set to path = " /usr/local/etc/file" monitor does not work

Started by Bing at February 12, 2016 - 11:27 AM

The problem is easy to solve, if you want to monitor the /usr/local/etc/ directory of the file file, you need only when the trigger events when the judge under the file name is file on it.

Posted by Miles at February 16, 2016 - 11:45 AM

I know. I just want to know Is it right? Alone cannot monitor the file, and then I don't know how to make the event file name
The file path event.path path not to send things just
Thank you

Posted by Bing at March 02, 2016 - 12:22 PM

  1. filename = os.path.join(event.path, event.name)

Posted by Miles at March 10, 2016 - 12:42 PM

Post code

Posted by Bevis at March 24, 2016 - 1:10 PM

Khan, long experience, the original Python and the module. . . .


------------------------------------
Welcome to my blog: www.danoking.com [DNK blog]

Posted by Nigel at March 26, 2016 - 2:07 PM

wm.add_watch(monitor_path, mask,rec=True,auto_add=True)
The answer is a little late, but still answer, because the problem is also entangled in online for a long time did not find the answer,
Rec=True is a good sub directory already established monitoring directory
This is the new auto_add=True directory add directory to monitor dynamic is added control created after joining the monitoring

Official manual add_watch function description
1864 @param auto_add: Automatically add watches on newly created
1865 directories in watched parent |path| directory.
1866 If |auto_add| is True, IN_CREATE is ored with |mask|
1867 when the watch is added.
1868 @type auto_add: bool

Posted by Oprah at March 31, 2016 - 2:35 PM

This module! (previous code to write, file modification OK, monitor file deletion is nodded high)

Posted by Hunter at January 03, 2017 - 10:47 AM