[Bug 214338] devel/glib20: patch: new kqueue() backend for file monitoring

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Nov 21 13:34:50 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214338

--- Comment #11 from Vladimir Kondratyev <wulf at cicgroup.ru> ---
(In reply to rozhuk.im from comment #10)
> 2. If file deleted it will reported.
It seems that I did not explain well what i meant.

We are watching for directory with hardlinked childs "1" and "2". They are
sharing same inode number as it is one file with 2 links to parent dir.

Than we rename "1" to "3" triggering NOTE_WRITE for parent directory filedesc

gio handler for NOTE_WRITE calls your code and at some point of time readdir()
loop reads entry for file "3" and find it as "new file".

Next step it tries to find out if this file has been renamed and after some
looping over previous directory content with 50% probability it stops at file
"2" with the same inode number and decides that "2" is the filename before
rename
But that is wrong as you would send 3 events in that case: '"1" is deleted',
'"2" is renamed to "3"' and '"2" is created'.

> 3. Im not sure about it. Code compare current files/subdirs metadata in dir with previous and report if changed.
> But if no event from kqueue() received for dir then no compare/report for files/subdirs.

IIRC, if directory is watched, file monitor should report child files attribute
changes and modifications. In kqueue() case it means that you should open()
every child file and watch for NOTE_ATTRIB, NOTE_WRITE and NOTE_CLOSE_WRITE
(and maybe NOTE_DELETE as it mapped to attribute changes sometimes) events.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-gnome mailing list