> -----Original Message----- > From: Beginner [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 14, 2007 10:56 > To: beginners@perl.org > Subject: polling a directory > > Hi, > > I am trying to find a means of monitoring a directory for activity. I > would like a perl process to aware if a file has been dropped into a > specific folder and then take some action. > > In the past I have used cron for this but I was thinking this isn't > the best choice because 1) You have to spawn a very frequently to try > to achieve real-time action 2) The high frequency spawning of a perl > script is quite expensive in terms of resources 3) There is the > potential for one process to collide with another. > > One way would be to have a script that did while (1) and a sleep when > nothing was found but again this seems "primitive". Is this something > that a daemon module might help with? Does anyone have an idea that > might help? > > TIA, > Dp. > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > I have a couple of different pollers which do exactly that: run in background ( not really as daemon, thouh that could be done), either view a particular directory or multiple directories and when I find something, then spawn some other Perl scripts to do the acutal work. Now for me, I am doing ftp from an IBM mainframe and also from Solaris. Together these two processes handle around 100k of internal emails a month for the business covering a wide band of topics. I have the output of the processing going to a file and I have an audittrail if problems occur.
You state cron, so assuming you are on a unix type setup. That is what I am running under. All very doable for you. If you have any problems or questions, please let me know. Wags ;) David R Wagner Senior Programmer Analyst FedEx Freight 1.408.323.4225x2224 TEL 1.408.323.4449 FAX http://fedex.com/us > ********************************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ********************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/