How to get the output of a command using EiffelProcess
This is a quite basic but essential operation: Launch a command, and get its output in a string.
There are various solutions.
- One is to redirect the output to a temporary file, and then read its content. But this is not convenient, since it require disk access, and you can not always hide the process.
- The most advanced (and still simple) solution is to use the Eiffel Process library.
Warning: you have to enable the multithreaded option to fully use the EiffelProcess pipe redirection.Warning: most of the time, you should precise absolute path to executable (such as "/bin/ls" instead of just "ls")