[physfs] physfs tutorial

Adam D. Moss adam at gimp.org
Thu Jan 15 12:27:11 EST 2004


Robby Dermody wrote:
> A quick question regarding physfs usage (probably something stupid I'm
> missing). I'm using Cygwin and physfs 0.1.9 (looked at the function in the
> 1.0.0 source and it looks the same, I have a large project and it would be a
> pain switching to 1.0.0 at this time unless it fixes this)
> 
> I initialized physfs fine, passed it argv[0] ("./gcm") which is the name of
> my program.
> 
> The problem is that PHYSFS_AddToSearchPath() keeps returning a zero with no
> failure reason. I have my archive files residing in a different directory
> than my program.
> 
> I call it with a archive path arg such as
> "./../../respacks/built/TestTheme/theme.tff"
> 
> Also, it doesn't work under test_physfs.exe as well:
> 
> addarchive ../../respacks/built/TestTheme/resource/terrain.rff 0
> Failure. reason: (null).

It could be because PHYSFS_AddToSearchPath() takes a platform-
specific path.  You could try using the attached function in your
program as a substitute for PHYSFS_AddToSearchPath(); it instead
adds the specified searchpath string that is:
* relative to wherever the program binary is, and
* in physfs-style (unix-style) platform-independant format.

Regards,
--Adam
-- 
Adam D. Moss   . ,,^^   adam at gimp.org   http://www.foxbox.org/   co:3
"At this point the rocket becomes engorged with astronauts."
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binrel.c
URL: <http://icculus.org/pipermail/physfs/attachments/20040115/65811938/attachment.diff>


More information about the physfs mailing list