Re: How to monitor a directory in FreeBSD?

From: meator <meator.dev_at_gmail.com>
Date: Sat, 13 Aug 2022 19:09:14 UTC
On 8/13/22 17:35, Gleb Popov wrote:
> 
> Yes, there is no native API to monitor directories. You can use 
> libinotify from ports, which replicates Linux inotify API and it does 
> have ability to monitor directories.
> 

I would like to avoid extra dependencies. If I would like to do this, 
than I would probably choose FAM of Gamin. The Linux Programming 
Interface book references these two as a more cross platform 
alternatives to inotify. The program I'm working on should also work on 
Linux. I'm currently want to implement both inotify and kqueue and make 
the preprocessor pick the right one when compiling.

But I didn't know inotify for BSD exists. This would mean that I 
wouldn't have to implement the directory monitoring twice. I'll take 
this into consideration. Thanks!