[physfs] windows eccentricities...

Ryan C. Gordon icculus at clutteredmind.org
Sat May 7 16:10:49 EDT 2005

> which brings me to another thing i've been thinking about.  can you push/pop 
> search paths?  it'd be nice to push "/" do my business then pop back to what 
> it was before.  i could handle this internally, but was just curious if 
> there was a way to deal with already inside physfs...

You can add to the front of the search path and remove it later.

> yeah, ms's services for unix uses some other mapping like "/dev/fs/c" or 
> something.  neither is ideal in that they imply a different "depth" in the 
> file system, but maybe it's not a huge issue.  perhaps i can setup a 
> "project path" using the mounting api and try to keep everything relative to 
> that path.  ideally, part of cross platform would mean that the program can 
> run using the same data/inputs on each platform it runs on.  having to 
> "refocus" a path or two when switching platforms isn't a deal breaker in 
> this regard.

Arguably, you have that depth on Windows anyhow, they just move it to a 
seperate "Drive" dropdown box...or, more recently, as a collection of 
folders with drive icons under the root "My Computer" icon.

> what do you mean by interpolated tree?

If you have C: and D: in the search path, and C:\file.txt and 
D:\file.txt both exist, you only see whichever is first in the search 
path...physfs "interpolates" each path into one unified filesystem, 
removing duplicate files. This is so you can override data with new 
archives without having to patch old ones, etc.

You can get around this with mount points: instead of adding C:\ to the 
search path, you "mount" it at something like /windowsdrives/c/, so that 
physfs will report files at /windowsdrives/c/file.txt and 

PHYSFS_addToSearchPath() is like mounting to "/".


More information about the physfs mailing list