monitor util in a scripted daemon?

Matthew Seaman m.seaman at
Fri Jul 23 20:44:49 UTC 2010

On 23/07/2010 20:58:06, Neil Smith wrote:
> - Is there a command (native, shell, or ports collection) to sit and watch for new file creation in a directory?

gamin --

> - I'd like to build a system startup script for such a command and its scripted actions. Sound possible?

It's in ports already.  Doesn't appear to have a separate rc script --
it's part of gnome, and would get run along with those applications.

> - Is there already something in the default OS that does something similar?

Look at kevent(2), kqueue(2) -- the EVFILT_VNODE filter can be used to
pick up changes to the link count of a directory: ie that a file has
been created or destroyed within it. Some C programming required.  AFAIK
there isn't a ready built application in the base OS to do what you want.



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID: matthew at               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list