[physfs] Lua Bindings

Gerry JJ trick at icculus.org
Wed Jul 15 23:14:12 EDT 2009

Den Wed, 15 Jul 2009 21:48:50 -0400
skrev Daniel Aquino <mr.danielaquino at gmail.com>:
> Has anyone ever shared lua bindings for physfs ?

I've done a couple times, but never really shared anything .. I could
maybe dig one up and clean it up a bit ..

> Mainly all I need right now is dofile() and require() to use physfs...

Don't forget loadfile.  Also, if you want it to be complete, everything
in io, package.loadlib, os.execute, os.remove, os.rename, maybe
os.tmpname.  Or just nil them.

Well, depends what you want to do..  Just PhysFS *support*, or
inability to use anything else ..

> I figure "physfs" would be a good module name to hold the functions...

I usually just replace the entire io module (well, only implementing the
parts I actually use..), so that all io go through physfs automatically
and I don't have to worry about it.

(This obviously won't work with code that use Lua's C api for loading
stuff though.  Not much to do about that .. Lua uses stdio all over the
place internally, so adding internal support isn't easy either.)

- Gerry

More information about the physfs mailing list