Re: [AD] File system watcher API

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


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;
  }
}

2012/1/4 David Capello <davidcapello@xxxxxxxxxx>
Is there someone working in a "file system watcher" API for Allegro 5?

For Windows we could use this the ReadDirectoryChangesW function:
http://msdn.microsoft.com/en-us/library/aa365465(VS.85).aspx

If no body is working on it, I could write the API and the Windows
implementation. Should this be part of the library or an addon?
Does physfs support this?




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