[physfs] usage with multiple archives with similar directory structure and API feature suggestion
Ryan C. Gordon
icculus at clutteredmind.org
Thu Jul 18 04:12:00 EDT 2002
> around this without having to change this directory structure. If not, the
> simplest think I think I can do is to enclose the contents of each resource
> file in a different directory, for example:
>
> maptiles.zip
> /maptiles
> info.xml
> /01
You'd probably have to do something like that. Part of the point of
PhysicsFS is that it interpolates a collection of directory trees into
one.
> The easiest way I see of doing this, given physfs's current API is to have
> something like PHYSFS_switchActiveConfig() and PHYSFS_getActiveConfig()
> functions.... by default active config 0, or whatever, will be used without
> having to call this (which will ensure backwards compatibility), but when
> the function is called, you are switched to another active configuration and
> you can define a different search path, etc. at will. This would be useful
> because you could have one configuration for when you read/write your main
> data files, and a different one for scripts that want to access your files.
> The configurations would be on a per-thread basis to ensure thread-safety.
> Now this could be done outside of physfs, with functions that clear the
> search/write/base paths and establish different defaults, but I think it
> would be cool if done within the library itself...including faster.
Again, I think it defeats the purpose of the API; if you just want access
to a collection of independent zip files, there are probably more
lightweight APIs you can use.
--ryan.
More information about the physfs
mailing list