[erlang-questions] gen_event streamer
Wed Dec 15 13:17:40 CET 2010
It should be able to run on Windows and Linux and the maximum resolution
should be 1 sec.
I have a prototype (non OTP) version that polls the directory with
file:list_dir(Dir). It should also be mentioned that for the most part, the
directory being watch will also be emptied as events get processed, so I
shouldn't run into an issue where there might be millions of files in a
folder which will slow down the polling.
What do you think?
On Tue, Dec 14, 2010 at 6:50 PM, Barry Nicholson <>wrote:
> Some further information would be helpful. Are you going to be doing
> this on unix/linux/windows? What OS? There are different mechanisms
> available for the different OSes. It might change the design.
> Also, what's the timing requirements? Do you want to know when the
> files get added immediately or can you wait a few seconds, a few
> minutes, or a few hours. This could also change the design.
> Barry Nicholson
> On 12/14/10 5:36 PM, Marcel Meyer wrote:
> > Hi there,
> > I would like to request your guidance in the following scenario where I
> > to follow OTP conventions:
> > I want to mount a process on a directory that fires an event when files
> > added or deleted. I thought the API should look like this:
> > fs_watcher:add_handler("/User/marcel/downloads/", pid).
> > fs_watcher:add_handler("/User/john/downloads/", pid).
> > Now I'm thinking that there should be 1 supervisor that keeps a process
> > each folder alive and sends a message to pid every time something happens
> > that folder, so in my example above, there would be 2 processes being
> > alive.
> > Am I talking about the server/streamer part of the gen_event?
> > Or do I need to roll my own by stitching an app/sup together that manage
> > spawned directory processes?
> > Regards,
> > Marcel
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
More information about the erlang-questions