I have a FreeBSD installation and a very large directory structure with 10TiB of small files.
I want to programmatically monitor and handle events such as a new file created or existing modified.
I have tried to use kqueue()
but it requires to open every directory and file. Traversing through the whole directory structure is taking too long and can never be finished in adequate time. (I even left it for a night and had no success.)
Is there another way to do the same on FreeBSD but in an efficient way?
By the way, does Linux handle such amount of data using inotify?
Thanks for any suggestions!