Patched to compile on iOS.
Added filesystem code to Mac and iOS Xcode projects.