Syntax error: Bad fd number when calling function system c++
-
On call:
system("ipfw pipe list >& pipe.lst");
Makes a return with a mistake.
Syntax error: Bad fd number
The same team, which has been made directly to the consoles, is performed without error. OS FreeBSD. The result of ipfw pipe list, including stderr, should be recorded in the file
-
That's right.
system("ipfw pipe list &> pipe.lst"); // пишем stdout и stderr
Pro http://tldp.org/LDP/abs/html/io-redirection.html details