Koozali.org: home of the SME Server

checking for not empty directory

Rob Wilkins

checking for not empty directory
« on: January 31, 2002, 12:10:26 PM »
How can I check for a not empty directory and do something if a file lands in it.

Example:
I would like to have e-smith check /user/Maildir/new for any new email files that appear and run a cron job to send a beep to the consol.

I am just looking for the routine or command to use to see if a directory has any files in it.

Thanks.

Damien Curtain

Re: checking for not empty directory
« Reply #1 on: January 31, 2002, 01:00:37 PM »
Rob Wilkins wrote:
>
> How can I check for a not empty directory and do something if
> a file lands in it.


test find /user/Maildir/new -type f && echo -e '\a'

--
 Damien