[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using glib's g_file_monitor_file and g_file_monitor_directory
From: |
Ted Zlatanov |
Subject: |
Re: Using glib's g_file_monitor_file and g_file_monitor_directory |
Date: |
Thu, 21 Mar 2013 10:06:32 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) |
On Wed, 20 Mar 2013 21:40:26 +0100 Michael Albinus <address@hidden> wrote:
MA> for GNU/Linux systems, we have inotify support now. As discussed when it
MA> was added, there are some drawbacks. So it seems to work for local file
MA> systems only; network file systems might work, or not.
MA> There is an alternative: glib's functions g_file_monitor_file and
MA> g_file_monitor_directory. They will use inotify when it is
MA> applicable. Otherwise, they implement polling, which is something we
MA> would need also in Emacs, when no native file monitoring is possible.
MA> g_file_monitor_file works even for gvfs mounted filesystems (I've tested
MA> with mounts of kind davs://..., smb://... and ftp://...). Likely, via
MA> polling.
MA> And it also has a kqueue backend for NetBSD (see
MA> https://mail.gnome.org/archives/commits-list/2012-November/msg03867.html). I
MA> don't know whether this is used widely, 'tho.
MA> What about adding this interface to Emacs, on C level? It could be in
MA> parallel to, or replacing the inotify interface.
I am in favor, replacing the existing inotify backend and keeping the
same API if possible, but there should be a way to avoid polling, even
disable it by default, and I hope it's asynchronous to some degree. You
can imagine how slow polling a ftp connection can be...
Ted