Get a file listing of a search path's directory.
Null-terminated array of null-terminated strings.
Matching directories are interpolated. That is, if "C:\mydir" is in the search path and contains a directory "savegames" that contains "x.sav", "y.sav", and "z.sav", and there is also a "C:\userdir" in the search path that has a "savegames" subdirectory with "w.sav", then the following code:
char **rc = PHYSFS_enumerateFiles("savegames"); char **i; for (i = rc; *i != NULL; i++) printf(" * We've got [%s].\n", *i); PHYSFS_freeList(rc);...will print:
* We've got [x.sav]. * We've got [y.sav]. * We've got [z.sav]. * We've got [w.sav].
Feel free to sort the list however you like. We only promise there will be no duplicates, but not what order the final list will come back in.
Don't forget to call PHYSFS_freeList with the return value from this function when you are done with it.
Note that Tao.PhysFs calls PHYSFS_freeList for you.
Fs Class | Tao.PhysFs Namespace