Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Listening for files in a directory

Reply
Thread Tools

Listening for files in a directory

 
 
Poul Møller Hansen
Guest
Posts: n/a
 
      01-13-2005
I'm trying to make a solution that can listen for files in a given
directory,
and process the files as soon they have been written.

So far I'm executing the script once per minute, but I would like a realtime
scan for files.
Does any of you know how to start on this ?

TIA, Poul


 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      01-13-2005
In article <41e62bd1$0$33639$(E-Mail Removed)> , Poul
Møller Hansen <(E-Mail Removed)> wrote:

> I'm trying to make a solution that can listen for files in a given
> directory,
> and process the files as soon they have been written.
>
> So far I'm executing the script once per minute, but I would like a realtime
> scan for files.
> Does any of you know how to start on this ?


Notification when a file is created sounds like an operating system
function, and I have never heard of any operating system offer this
function as a general feature. It is usually up to the processes
involved to notify each other when some event has occurred.

As a work around, I would just keep a script running all of the time
increase the frequency of checking. If you code the process
efficiently, you should be able to check every second. Of course, your
ultimate speed depends upon your hardware and your operating system. If
you want faster response, you are going to have to modify the process
creating the files so it can notify or spawn the process that wants to
know about the new files.

FYI: this newsgroup is defunct; try comp.lang.perl.misc in the future.

--
Jim Gibson


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      01-16-2005
Jim Gibson wrote:
> In article <41e62bd1$0$33639$(E-Mail Removed)> , Poul
> Møller Hansen <(E-Mail Removed)> wrote:
>
>>I'm trying to make a solution that can listen for files in a given
>>directory, and process the files as soon they have been written.
>>
>>So far I'm executing the script once per minute, but I would like a realtime
>>scan for files. Does any of you know how to start on this ?

>
> Notification when a file is created sounds like an operating system
> function, and I have never heard of any operating system offer this
> function as a general feature.


Linux has it. I don't know if it is older versions, but Red Hat 9
includes SGI's File Alteration Monitor which meets the requirements.

http://search.cpan.org/~jglick/SGI-F...lib/SGI/FAM.pm

-Joe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() are not returning the specified directory Nathan Sokalski ASP .Net 2 09-06-2007 03:58 PM
Listening to mp3 files embedded in web pages - Is QuickTime required? RichCI Firefox 2 01-24-2007 05:04 PM
Interruptions in live news listening Realone Player listening Thaqalain Computer Support 6 07-16-2005 02:11 PM
Directory and files names in temporary asp.net directory =?Utf-8?B?QmFzIEhlbmRyaWtz?= ASP .Net 5 01-31-2005 01:56 PM
list all css files in a directory and sub directory TJS ASP .Net 1 06-23-2004 10:49 AM



Advertisments