Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Aug 2022 09:00:18 +0300
From:      "Zeus Panchenko" <zeus@ibs.dn.ua>
To:        "=?us-ascii?Q?=3D=3FUTF-8=3FQ=3FMicha=3DC5=3D82=5FG=3DC3=3DB3rny=3F=3D?=" <mgorny@moritz.systems>
Cc:        "meator" <meator.dev@gmail.com>, "Gleb Popov" <arrowd@freebsd.org>, "freebsd-hackers" <freebsd-hackers@freebsd.org>
Subject:   Re: How to monitor a directory in FreeBSD?
Message-ID:  <20220814090018.68722@relay.xx>
In-Reply-To: Your message of Sat, 13 Aug 2022 21:19:16 %2B0200 <0cb00216675d883162148e6dc1e0b90c4c8be5f2.camel@moritz.systems>
References:  <652f3c12-388c-04d0-ebeb-753b76b2b742@gmail.com> <CALH631m_q2VF8N4M%2ByCQVu4%2BeF6uue3TZ6KY%2BYzGc_zeWVa3bw@mail.gmail.com> <d65728ec-935f-a1bc-a519-b6c82ca78ea8@gmail.com> <0cb00216675d883162148e6dc1e0b90c4c8be5f2.camel@moritz.systems>

next in thread | previous in thread | raw e-mail | index | archive | help

may be, try to look on sysutils/direvent


Micha=C5=82 G=C3=B3rny <mgorny@moritz.systems> wrote:
> On Sat, 2022-08-13 at 21:09 +0200, meator wrote:
> > On 8/13/22 17:35, Gleb Popov wrote:
> > >=20
> > > Yes, there is no native API to monitor directories. You can use=20
> > > libinotify from ports, which replicates Linux inotify API and it does=
=20
> > > have ability to monitor directories.
> > >=20
> >=20
> > I would like to avoid extra dependencies. If I would like to do this,=20
> > than I would probably choose FAM of Gamin. The Linux Programming=20
> > Interface book references these two as a more cross platform=20
> > alternatives to inotify. The program I'm working on should also work on=
=20
> > Linux. I'm currently want to implement both inotify and kqueue and make=
=20
> > the preprocessor pick the right one when compiling.
> >=20
> > But I didn't know inotify for BSD exists. This would mean that I=20
> > wouldn't have to implement the directory monitoring twice. I'll take=20
> > this into consideration. Thanks!
>=20
> I'm afraid I'm going to be a bit of spoilsport but please bear in mind
> that inotify -- at least on Linux -- is not 100% reliable (or at least
> it wasn't the last time I've used it).  In general, it's a great
> optimization but your program also needs to have fallback logic to
> periodically check for changes that weren't reported.
>=20
> --=20
> Best regards,
> Micha=C5=82 G=C3=B3rny
>=20
>=20
>=20
<#secure method=3Dpgp mode=3Dsign sender=3D0FF7A32A>

--=20
Zeus V. Panchenko				jid:zeus@im.ibs.dn.ua
IT Dpt., I.B.S. LLC					  GMT+2 (EET)



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