Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2016 13:34:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        gnome@FreeBSD.org
Subject:   [Bug 214338] devel/glib20: patch: new kqueue() backend for file monitoring
Message-ID:  <bug-214338-6497-zIrxomKuNH@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-214338-6497@https.bugs.freebsd.org/bugzilla/>
References:  <bug-214338-6497@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D214338

--- Comment #11 from Vladimir Kondratyev <wulf@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 filede=
sc

gio handler for NOTE_WRITE calls your code and at some point of time readdi=
r()
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 fi=
le
"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 d=
ir 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 attri=
bute
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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-214338-6497-zIrxomKuNH>