/** * Returns the next line output by the process, up to $maxbytes bytes * @param string $fileId the unique file id generated by ProcMonitor::Start * @param int $maxbytes the maximum number of bytes to retrieve from a line * @return string a line of output from the process */ public function GetOutput($fileId, $maxbytes = 1024) { $handle = fopen(ProcMonitor::GetFName($fileId), "r"); $bytesRead = procMonitor::GetBytesRead($fileId); fseek($handle, $bytesRead); $output = fgets($handle, $maxbytes); $bytesRead += strlen($output); ProcMonitor::SetBytesRead($fileId, $bytesRead); return $output; }