emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs inotify support?


From: Giuseppe Scrivano
Subject: Re: Emacs inotify support?
Date: Sat, 12 Sep 2009 23:24:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Date: Sat, 12 Sep 2009 19:26:14 +0200
>> From: Antoine Levitt <address@hidden>
>> Cc: address@hidden, address@hidden, address@hidden
>> 
>> > > Date: Sat, 12 Sep 2009 18:36:47 +0200
>> > > From: Antoine Levitt <address@hidden>
>> > > Cc: address@hidden, address@hidden, address@hidden
>> > >
>> > > If possible, polling should be avoided, though.
>> >
>> > Why?
>> 
>> Well, I don't know much about file systems, but isn't it always better
>> to be notified than to poll ?
>
> But (AFAIU) inotify works by giving the application a file descriptor
> that the application needs to pass to `select' or `poll' in order to
> get notifications.  This is exactly the kind of ``polling'' Emacs does
> with any external event (except for signals).

There are events that can't be catched directly with a `select' or
`poll'.  For example, to check if a file was modified there is need to
`stat' it, using inotify you will see this change immediately and
avoiding unuseful `stat's at fixed intervals.

Inotify events are read from the inotify instance descriptor, that is a
blocking file descriptor.  So you can mix it in a `select' with
sockets/pipes/etc.


Cheers,
Giuseppe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]