[LA.pm] Monitoring a directory using Event.pm
Ofer Nave
ofer at netapt.com
Wed Jun 8 13:10:59 PDT 2005
I'm no expert, so I could be wrong, but to my knowledge:
The Event module, unfortunately, has nothing to do with this. What you
want is an event-based filesystem, where modifications can trigger
actions. The standard linux file system doesn't do this. There are some
groovy new FSs that do this, but you probably don't want to go that route.
Although it seems brute force, then best solution is probably write your
script as daemon (run in the background continuously) and have it
continuously look for new files to appear (sleep 1 in a loop or
something).
If you're heart is dead set on making this event driven, then make your
daemon listen on a port, and modify your client-side code so that it
connects to that port and sends a message after FTPing the file.
-ofer
On Wed, 8 Jun 2005, Ranga Nathan wrote:
> I have a need to run a script when a file is received into a directory via
> FTP. This is Linux SuSE9 environment.
> I am looking at Event.pm documentation. Can some one show me examples of
> how to monitor a directory for new files?
> If there are other elegant methods I would like to know.
>
> As a last resort, I can hand-roll one. But why re-invent the wheel?
> __________________________________________
> Ranga Nathan / CSG
> Systems Programmer - Specialist; Technical Services;
> BAX Global Inc. Irvine-California
> Tel: 714-442-7591 Fax: 714-442-2840
>
> _______________________________________________
> Losangeles-pm mailing list
> Losangeles-pm at pm.org
> http://mail.pm.org/mailman/listinfo/losangeles-pm
>
More information about the Losangeles-pm
mailing list