RunProgram, command line and MacOS
Posted: Tue Nov 03, 2020 11:18 am
I'm in an awkward situation where I'm having to code an app for Windows and Mac, but I have never programmed for Mac in my life, and I don't even have a Mac computer to do development work on. I will have access to a friend's Mac in order to compile the app - but only once a day.
Luckily, 95% of my code uses PB's internal commands. The only problems I can foresee come from using external utilities - Curl, FFMPEG and SoX.
I've learned that MacOS has Curl built in. Can anyone tell me what would be the equivalent of this Windows code?
The other two utilities (FFMPEG and SoX) are more complicated, because they are not built into MacOS. Would they have to be installed on the user's system by an installation process, or could they simply be included with the app as standalone utilities, like on Windows?
I realise these are all "newbie" questions, but I'm guessing that asking them here is the fastest way to get the answers. I'll be grateful for any help.
Luckily, 95% of my code uses PB's internal commands. The only problems I can foresee come from using external utilities - Curl, FFMPEG and SoX.
I've learned that MacOS has Curl built in. Can anyone tell me what would be the equivalent of this Windows code?
Code: Select all
*Buffer = AllocateMemory(SizeOf(Double))
prog.i = RunProgram("H:\curl.exe",param,WorkingDirectory,#PB_Program_Open|#PB_Program_Read)
While ProgramRunning(prog)
If AvailableProgramOutput(prog)
NumOfBytes = ReadProgramData(prog, *Buffer, SizeOf(*Buffer))
OutputString$ + PeekS(*Buffer, NumOfBytes, #PB_UTF8)
EndIf
Delay(50)
Wend
CloseProgram(prog)
I realise these are all "newbie" questions, but I'm guessing that asking them here is the fastest way to get the answers. I'll be grateful for any help.