Listening for files in a directory

  • Thread starter Poul Møller Hansen
  • Start date
P

Poul Møller Hansen

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
 
J

Jim Gibson

Poul said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top