Re: [AD] File system watcher API |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
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?
For your proposed interface, I think that would require a separate
thread to do the monitoring. Just pointing it out.
Peter