I'm playing around with rb-kqueue on OS X and I can't work out how to get the extend flag to fire.
From the OpenBSD kqueue man page (which also matches the OS X man page):
NOTE_EXTEND The file referenced by the descriptor was extended
Which is very circular.
The FreeBSD kqueue man page has:
NOTE_EXTEND For regular file, the file referenced by the descriptor was extended. For directory, reports that a directory entry was added or removed, as the result of rename operation. The NOTE_EXTEND event is not reported when a name is changed inside the directory.
This is a lot more descriptive, however, I've been running a kqueue on a directory and try as I might I cannot get the extend flag to fire. I've tried mv, rename, xattr (because searching for "extended" brings back lots of results on extended attributes), adding sub dirs and files with mkdir and touch and redirects but nothing results in the extend flag being part of an event, just write and/or link.
Hence I'm confused as to what extend really is. Is it just because I'm running it on OS X?
I hope to shed some light on this issue.
The flag
NOTE_EXTENDcorresponds to the action taken on a file. In your case you should trigger the action when a file size has increased.The reasoning
To quote the original paper - Kquote: A generic and scalable event notification facility:
The Figure 3 for
EVFILT PROC: