process runing automatically

Hi, I need some help, because I'm trying to create a process runing all the time (not invoqued by a crontab), like a daemon, to detect the creation of a new file in a specific directory and axecute a process wich do something with this new file.
Can you help me?

For your information my Unix is a Unixware 7.1.1.
TKS.

This is a really cheap way but will work unless the directory is constantly changing.

#!/bin/sh
DIRECTORY=/path/to/dir
until [ 0 -eq 1 ]; do
NEW=`ls -l $DIRECTORY | wc -l`
if [ $NEW ! -eq $OLD ]
then do whatever notification you want
fi
sleep 30 #checks every 30 seconds
OLD=$NEW
done

Change whats in bold. Place this script in /etc/rc3.d

Hi, thanks a lot for you help. But the deamon starts fine, works fine but have some secundary effects on the system.
The system can not shutdown, you can not do telnets to the server, how can I solve these little problems?
Thanks again.