Hi Felix,
no way to get the output directly, because Basic would need
to handle
pipes then.
It is under consideration whether UNO should be extended to
give
support for standard IO, see #i53061#.
Workaround is either such glue stuff like you presented or
to use
another (UNO-supported) language, for example Python, which
does this
stuff in a few lines of code easily (os.popen).
2006/1/26, Felix E. Klee <fk linuxburg.de>:
> I'd like to execute an external program (under LINUX)
from within a Basic
> script, and I would like to obtain it's stdout, stderr
and it's return value.
> I know that I could do it for example as follows
(untested):
>
> 1. Shell( _
> "/bin/bash -c 'some_program >/tmp/out
2>&1; echo $? >/tmp/retval'")
>
> 2. Read the files "/tmp/out" and
"/tmp/retval".
>
> But, is there a simpler way? Is there an alternative
to "shell"?
--
Best Regards
Christian Junker
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|