It is technically available on OSX, but it doesn't work in the particular build of Lua that 0.8.0 for OSX is packaged with, for whatever reason. If you use a version of LÖVE
built with LuaJIT, it should work fine.
EDIT: I just built LÖVE 0.8.0 using a fixed/upgraded version of Lua 5.1. io.popen should work now, and as a bonus it uses OpenAL Soft instead of Apple's buggy OpenAL implementation, so many OSX-specific audio bugs should be fixed as well. Here it is:
https://dl.dropbox.com/u/4214717/love-osx.zip
Note that the "nproc" command isn't available in OSX. If you want to get the number of physical cores in OS X, you can use something like this command:
Code: Select all
io.popen("system_profiler SPHardwareDataType | grep -i 'total number of cores'")
It will produce a string like this, which you can parse: " Total Number of Cores: 4"
Or if you don't mind including Intel's hyperthreading in the core count, this should work in OS X:
It produces a string like "8".
To detect the operating system the user is running, you can check the
love._os string. It will return "Windows", "Linux", "OS X", or "Unknown".