Re: [AD] File system watcher API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


2012/1/4 Peter Wang <novalazy@xxxxxxxxxx>
On Wed, 4 Jan 2012 09:59:19 -0300, David Capello <davidcapello@xxxxxxxxxx> wrote:
> The basic idea is to be able to listen to file/directories
> changes. The API could be something like this:
>
> ALLEGRO_FS_ENTRY* fsentry = ...;
>
> al_register_event_source(queue,
>   al_get_fs_entry_event_source(fsentry));
>
> while (...) {
>   ALLEGRO_EVENT ev;
>   al_wait_for_event(queue, &ev);
>
>   switch (ev.type) {
>     case ALLEGRO_EVENT_FS_ENTRY_CHANGED: ...; break;
>     case ALLEGRO_EVENT_FS_ENTRY_DELETED: ...; break;
>     case ALLEGRO_EVENT_FS_ENTRY_NEWCHILD: ...; break;
>   }
> }

Can you make a case for why this feature needs to be in Allegro or an
addon?  For real paths it could just as well be implemented in user
code, so the only reason I can see to include it is portability.
Is it useful enough for typical Allegro programs to warrant that?

There is no need to be in Allegro or an addon. It can easily be
in other library. I though Allegro was using PIDLs in the Win32
impl for the file system API. So I'll create my own library.
Thanks anyway
 
For your proposed interface, I think that would require a separate
thread to do the monitoring.  Just pointing it out.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/