473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Listening for files in a directory

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
Jul 19 '05 #1
2 3987
In article <41***********************@dread16.news.tele.dk> , Poul
Møller Hansen <tu*@pbnet.dk> 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 =---
Jul 19 '05 #2
Jim Gibson wrote:
In article <41***********************@dread16.news.tele.dk> , Poul
Møller Hansen <tu*@pbnet.dk> 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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Anand K Rayudu | last post by:
Hi all, I am trying to find a way to get the files recursively in a given directory, The following code is failing, can some one please suggest what could be problem here from os import...
6
by: Peter Row | last post by:
Hi, Can someone give me a set of steps for an ASP.NET project (well actually its just a VB.NET class DLL that implements HttpHandler) that will work when moved to another developers machine? ...
5
by: Bas Hendriks | last post by:
Has anyone any idea how asp.net find it's files back after compiling them to the temporary asp.net directory? I found on numerous webpages that the directorynames are chosen random but cannot find...
10
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in...
23
by: **Developer** | last post by:
Is there an easy way to copies all files in a directory into another directory? What about coping subdirectories too? Thanks in advance for any info
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
1
by: dkmarni | last post by:
Hi, I am trying to do this perl script, but not able to complete it successfully. Here is the description what the script has to do.. Accept two and only two command line arguments. Again,...
10
by: 7stud | last post by:
I'm trying to get Apache set up on my system so I can use mod_python. I installed Apache 2.2.4 according to the following instructions: ...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.