Tal, I work on Solaris. Isn't there a portable module around ? Yossi
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tal Kelrich Sent: Thursday, March 27, 2008 12:29 PM To: [email protected] Subject: Re: [Israel.pm] How to detect a new file in a directory without busy wait ? On Thu, 27 Mar 2008 11:50:35 +0200 Yossi Itzkovich <[EMAIL PROTECTED]> wrote: > Hi, > > I have a script that should wait for a new file to be created, and > then start processing it. I don't know the filename, just the pattern > (known prefix). I can do it like this > > While (1) > { > get directory content > check each file for filename pattern. If found - last. > sleep for few 100ms > } > > But I guess there is a more elegant way. Is there ? > You should look at Win32::ChangeNotify and Linux::Inotify2, depending on your platform. Cheers, Tal -- Tal Kelrich PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F CAE6 FEC1 9AAC 12B9 AA69 Key Available at: http://www.hasturkun.com/pub.txt ---- The chief enemy of creativity is "good" sense -- Picasso ---- _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
