Attached is a patch which implements al_change_directory() in the PHYSFS add-on.
I have been working on porting one of my games to Android and have come to the decision that I will be using PHYSFS to access my game's data files.
In my quest to reduce platform-specific code as much as possible, I have implemented in my framework a resource locating function which relies on al_change_directory() to make loading data as platform independent as possible. Basically, I check a few places to see where the data is actually located and change to that directory.
On Android I had a few options for loading my data. I have been using the APK file interface for a while, but that is turning out to be less than ideal for my needs. I turned to PHYSFS because of this post. I think it will solve the remaining issues I am having with my project.
Now the problem, and the reason I made this patch, is that the data for Android projects is stored in a particular subdirectory inside of a ZIP file. Without a functioning al_change_directory() I would need to come up with a solution to modify the filenames of all files I access in my project depending on which platform I am working with.
The patch implements al_change_directory() by storing a current working directory and appending relative paths to it when accessing the file system or files. The current working directory is the root directory by default. Calls to al_change_directory work like you would expect. Relative and absolute paths are supported.