I use a GetShellOutput( commandstring.s ) procedure to interface to the Linux shell commands (ls, du, df, env etc.).
If you iterate a RunProgram more than around 1000 times, RunProgram will return 0 (fail). On a production server it lasts 1016, on my local machine 1006 or 1003.
Code: Select all
Procedure.s GetShellOutput( cmd.s )
Static tmpcount
prg = RunProgram(cmd,"","",#PB_Program_Open|#PB_Program_Read) : tmpcount+1 : Debug tmpcount
If prg
While ProgramRunning(prg)
out.s=out+ReadProgramString(prg)+#LF$
Wend
Else
Debug "!!! Cannot RunProgram "+#DQUOTE$+cmd+#DQUOTE$
EndIf
ProcedureReturn out
EndProcedure
For a=0 To 1100
Debug GetShellOutput("date")
Next
Any help is very appreciated.