OSX and PhysFS

Eric Wing ewing2121 at yahoo.com
Tue Dec 17 03:58:52 EST 2002


Hello Ryan (and other PhysFS maintainers),

If you're interested, I have built a PhysFS Framework
and ProjectBuilder project for OSX (based on how other
SDL frameworks were made). Would you like me to send
them to you? (BTW, did you receive my ogg patch for
SDL_sound?)

Also, I thought I should alert you to an OS X
idiosyncrasy you may want to address. The Unix stuff
works great for PhysFS. (I couldn't actually get any
of the MacClassic stuff to compile in OSX.) However,
the Unix stuff might work a little to well...

For Unix style built programs, PhysFS is perfectly
fine. However, if you build a project via
ProjectBuilder style, the executables that get created
are a little strange which has a consequence to what
PhysFS computes as the base directory.

If I try building a program called "MyTest" in Project
Builder, it creates a Mac style execuatable called
"MyTest.app". However, to Unix, this MyTest.app looks
like a directory structure with a bunch of files and
subdirectories (and are completely hidden by Finder).
I think this is related to Resource Forks which I
don't completely understand. 

So to the Mac GUI, I have a single program with the
listing of:
/Users/me/my_programs/MyTest.app

However, to Unix, MyTest.app is a directory with a
bunch of information and the Unix executable buried
inside.
/Users/Me/my_programs/MyTest.app
  /Contents/
  /Contents/Info.plist
  /Contents/PkgInfo
  /Contents/pbdevelopment.plist
  /Contents/Resources/
    English.lproj/
      InfoPlist.strings
  /Contents/MacOS/
    MyTest*  <-- This is the Unix executable

If I launch this program (MyTest.app) from the GUI
interface (desktop/Finder/dock), OSX seems to pass the
Unix path:

/Users/Me/my_programs/MyTest.app/Contents/MacOs/MyTest

to argv[0], so PhysFS translates:

/Users/Me/my_programs/MyTest.app/Contents/MacOs/
instead of:

/Users/Me/my_programs/MyTest.app/
 into the Base Directory.

However, this is inconvenient because the base
directory should be MyTest.app because you can't
actually put data files inside because OSX tries to
hide the fact that it is a directory. So if I have
config files, or game files, or data, PhysFS won't let
me see them because the base directory is 2 levels too
low.

You also cannot double-click on the
Content/MacOS/MyTest if you tried moving it via Unix
so it was visable. The whole structure needs to be
intact.

Perhaps you guys have a good solution to this issue?

Thanks,
Eric



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the physfs mailing list