Description
This method runs an external program which has already been loaded using findProgram. The results of this run are available in a ProgramRun object.
i1 : gfan = findProgram("gfan", "gfan --help")
o1 = gfan
o1 : Program
|
i2 : runProgram(gfan, "_version")
o2 = 0
o2 : ProgramRun
|
i3 : oo#"output"
o3 = Gfan version:
gfan0.7
Forked from source tree on:
1723478415 Mon Aug 12 18:00:15 2024
Linked libraries:
GMP 6.3.0
Cddlib YES
SoPlex YES
Singular NO
|
i4 : runProgram(gfan, "_foo", RaiseError => false)
o4 = 256
o4 : ProgramRun
|
i5 : oo#"error"
o5 = UNKNOWN OPTION: _foo.
USE --help AS A SINGLE OPTION TO VIEW THE HELP TEXT.
|
The value corresponding to the "output" key may also be obtained using toString.
i6 : toString runProgram(gfan, "_version")
o6 = Gfan version:
gfan0.7
Forked from source tree on:
1723478415 Mon Aug 12 18:00:15 2024
Linked libraries:
GMP 6.3.0
Cddlib YES
SoPlex YES
Singular NO
|
It is also possible to skip findProgram and just provide two strings: the name of the program and the command line arguments.
i7 : runProgram("normaliz", "--version")
o7 = 0
o7 : ProgramRun
|
i8 : peek oo
o8 = ProgramRun{command => /usr/bin/normaliz --version }
error =>
output => Normaliz 3.10.4
------------------------------------------------------------
with package(s) CoCoALib Flint e-antic nauty hash-library
Copyright (C) 2007-2022 The Normaliz Team, University of Osnabrueck.
This program comes with ABSOLUTELY NO WARRANTY; This is free software,
and you are welcome to redistribute it under certain conditions;
See COPYING for details.
return value => 0
|
Internally, this routine uses run. Another way to interact with programs is to pass a string beginning with "!" to get, openIn, openOut, or openInOut.