I need to write c++ code that uses the ACE library to create a process by building a string of its command line and redirect its output to a text file. I tried to use ACE_Process and ACE_Process_option classes. I set ACE_Process_option.command_line by using the following format, with the redirect operator: " > ". Unfortunately, it didn't work: the string that I build (the value of ACE_Process_option.command_line field) activates the process and redirect it to a text file when I write it in the cmd (the command line console), but it doesn't work when I try to use it from the code. Any ideas how to do it?
Asked
Active
Viewed 323 times
1 Answers
1
Check chapter 10 of the ACE Programmers Guide. The example code of this section is available as part of the ACE distribution under examples/APG/Processes
, see the Manager::setStdHandles
operation as part of the Spawn.cpp
example

Johnny Willemsen
- 2,942
- 1
- 14
- 16
-
Thank you very much Johnny :-). It seems to be exactly what I've been looking for. I'll check it – user3179744 Jan 11 '14 at 09:24