ReadProgramData()
Syntax
Result = ReadProgramData(Program, *Buffer, size)Description
Reads data from the given programs output (stdout) and puts it in the specified buffer (a memory area will be reserved by using AllocateMemory()).
The program must have been started with RunProgram() and the #PB_Program_Read flag.
The function reads up to 'size' bytes, but also less if not that much is available (but it will not return zero bytes because it always waits for some data to read). Check the returnvalue to know how much data was actually read.
Note: This function waits until there is data available to read from the program. To prevent this wait, AvailableProgramOutput() may be used first to check if there is something to read.
Return value
Returns the number of bytes that were actually read.
Supported OS
All