watchFile, persistent and interval

226 views
Skip to first unread message

Viktor

unread,
Mar 24, 2010, 7:10:55 AM3/24/10
to nodejs
Hi All,

I'm using the fs.watchFile and i'd like to know more about the config
parameters, the persistent and interval.
I checked the source (node_stat_watcher.cc) but i still don't have any
idea.

As far as I saw, it takes 3--5 seconds to notice the changes (with the
default settings), can i make it faster?
how heavy is watching hundreds of files?

thx, best,
Viktor

Ryan Dahl

unread,
Mar 24, 2010, 10:28:01 AM3/24/10
to nod...@googlegroups.com
On Wed, Mar 24, 2010 at 4:10 AM, Viktor <kelemen...@gmail.com> wrote:
> Hi All,
>
> I'm using the fs.watchFile and i'd like to know more about the config
> parameters, the persistent and interval.
> I checked the source (node_stat_watcher.cc) but i still don't have any
> idea.

Interval is relavent where inotify is not available - it determines
how long to poll for updates.

Persistent has to do with how the program should act when nothing but
watchFile is running. The default is to exit.

> As far as I saw, it takes 3--5 seconds to notice the changes (with the
> default settings), can i make it faster?

On linux it uses inotify - which is faster

> how heavy is watching hundreds of files?

Heavy. It's not meant for that.

Viktor

unread,
Apr 3, 2010, 3:54:57 AM4/3/10
to nodejs
good to know.

thanks, best
Viktor


On Mar 24, 11:28 pm, Ryan Dahl <coldredle...@gmail.com> wrote:


> On Wed, Mar 24, 2010 at 4:10 AM, Viktor <kelemen.vik...@gmail.com> wrote:
> > Hi All,
>

> > I'm using the fs.watchFileand i'd like to know more about the config


> > parameters, the persistent and interval.
> > I checked the source (node_stat_watcher.cc) but i still don't have any
> > idea.
>
> Interval is relavent where inotify is not available - it determines
> how long to poll for updates.
>

> Persistent has to do with how the program should act when nothing butwatchFileis running. The default is to exit.

Reply all
Reply to author
Forward
0 new messages