mount points...

Ryan C. Gordon icculus at
Mon Mar 14 02:42:00 EST 2005

...the initial mount points code is in Subversion. It's based on Philip's
patch, but there were about a thousand corner cases I needed to handle, and
some internals had changed dramatically (and, y'know, I can't leave well
enough alone...)

There are some notes:

   PHYSFS_mount("", "/mods/alien_swarm", 1);

...mounts at /mods/alien_swarm. /mods and /alien_swarm don't have to
exist, but they will be treated as real directories as long as is in
the search path. Effectively, PHYSFS_mount is like PHYSFS_addToSearchPath(),
but every file in the archive will have /mods/alien_swarm appended to it.

Conversely, PHYSFS_addToSearchPath("", 1) is like
PHYSFS_mount("", "/", 1).

So if contains "data/aliens.txt", then you could access it with
PHYSFS_openRead("/mods/alien_swarm/data/aliens.txt") ...

There's also PHYSFS_getMountPoint(""), which, in this case, returns

The immediate use for this is to let you sandbox external content...if you let
people download packages into your game/app, then you can use a mount point to
guarantee it won't conflict with existing packages.

I've only tested it briefly, and I'm sure there will be bugs.


More information about the physfs mailing list