How can I check programatically if System is 32/64 bit (Mac)
Posted: Sat Apr 27, 2013 5:15 pm
Any help appreciated 
http://www.purebasic.com
https://www.purebasic.fr/english/
wilbert wrote:Maybe a silly question but why would you want to ?
OS X 32 bit can run 64 bit applications and OS X 64 bit can run 32 bit applications.
The only important thing is if the CPU is capable of 64 bit. From the intel based Mac's, only the first generation that wasn't sold for very long didn't have 64 bit support.
Most users will probably be able to run a 64 bit application but if you want to be sure, you can always compile a 32 bit application.
Code: Select all
GetBit = RunProgram("uname", "-m", "", #PB_Program_Open | #PB_Program_Read)
Bit$ = ""
While ProgramRunning(GetBit)
If AvailableProgramOutput(GetBit)
Bit$ = ReadProgramString(GetBit)
EndIf
Wend
CloseProgram(GetBit)
Debug Bit$Thanks for the info. But I am looking for an api, rather not use terminal.J. Baker wrote:Code: Select all
GetBit = RunProgram("uname", "-m", "", #PB_Program_Open | #PB_Program_Read) Bit$ = "" While ProgramRunning(GetBit) If AvailableProgramOutput(GetBit) Bit$ = ReadProgramString(GetBit) EndIf Wend CloseProgram(GetBit) Debug Bit$
sysctl can be used as an api, you don't need to use it from the terminal.spacebuddy wrote:I was using sysctl hw.cpu64bit_capable from the terminal, but removed it from the program.