ExecProcess_2

Executing an synchronous process using the operating system. The example exec.min is easy to use and integrate.

It also shows how to work with the input, output, error streams in either file or prolog list form, whichever is more convenient for the application.

The example is configured as standalone, but can also be used as servlet.

% exec(+Commandline) :-
% exec(+Commandline,-ExitCode) :-
% exec(+Commandline,-ExitCode,InputLines) :-
% exec(+Commandline,-ExitCode,InputLines,OutputLines) :-
% exec(+Commandline,-ExitCode,+InputLines,-OutputLines,-ErrorLines) :-
% exec_files(+Commandline,-ExitCode,+InputFile,+OutputFile,+ErrorFile) :-

Examples:

minerva -l exec

?- exec(ls) ?- exec('ls -l',ExitCode,[],OutputLines). ?- exec('Mail -s test me@work',E,[hello,you],Out,Err). ?- exec_files('Mail -s test me@work',E,'exec.min','out.log','err.log').


Up read on...