LaunchProgram and handling stdout

Hi !
I’m running a bunch of commands through LaunchProgram().
Is it possible to handle it’s stdoutput using usual RegExp’s placed in .dlinit ? It’s not working for me …
When I was running rendering through RunManagedProcess(), all my RegExps worked OK.

Some more details (fragments):
my .dlinit file contains:

OutputRegEx1=.*Received signal 11.*
OutputRule1=FailRender( GetRegExMatch(0) );

OutputRegEx2=ERROR.*|error.*|RIB error.*|.*Unable to find shader.*|.*Unable to find out device.*|.*3DL ERROR.*
OutputRule2=FailRender( GetRegExMatch(0) );

RenderTasks=ExecuteScriptFile( "RenderTasks.ffs" );

Rendering takes place in RenderTasks.ffs

rFile= OpenFile(renderScriptFile, "r" );
for( i = 0; i < 1; i = i ) 
{
	if( EndOfFile( rFile ) )
			break;
		
	cmdline = ReadLineFromFile( rFile );
	parline = ReadLineFromFile( rFile );
	LogInfo(cmdline .. " " .. parline);
	LaunchProgram(-1, cmdline, parline, renderScriptDir);
}	

Using LaunchProgram just runs the program and waits for it to complete. There is no way to control the process or use regular expressions to handle stdout. Use RunManagedProcess if you want to have more control over the process.

Cheers,

  • Ryan

thanx for quick reply!
I reconstructed the plugin to use managedProcess.
Now, where should I place my RegEx rules for this processes , in .dlinit file ?

Ugh, you’re making me refer back to the 2.7 plugin system… :slight_smile:

You should place the regex’s in the *.mpr file that RunManagedProcess() is referring to.

Cheers,

  • Ryan