Does anyone know the equivalent of the F_NOTIFY flag for the fcntl function in a BSD-based system? This flag allows you to receive notifications about file events (for example, the file is open, the file is closed, bytes are written to the file, bytes are read from the file). This flag exists on Linux, but does not exist on MACOSX (BSD-based system).
Quote from linux man:
File and directory change notification (Dnotify)
int fcntl (int fd, int cmd, ... / * arg * /);
F_NOTIFY (long) (Starting with Linux 2.4) Provide a notification when a directory called fd or any of the files that it contains changes.
Actually for me there will be enough API which allows me to receive files.
Does anyone know if there is any replacement for F_NOTIFY? At this time, I have only one idea: using the kqueue (), kevent () functions.
source
share