As usual, there is more than a way to do it.
Someone was mentioning AntiVirus technology. Well, on GNU/Linux and FreeBSD there is an opensource module
Dazuko that comes with a Perl module (surprise!) to interface with it.
This means that it is trivial to hook into the kernel and find out in real time when a file changes.
This means that you know "instantly" when a file is added or changed.
It may be way too much for what you want, but it can also suit your needs.
P.S.: using the module without care can be
Dangerous .