kazeits has asked for the wisdom of the Perl Monks concerning the following question:
gcov then produces a .gcov file ./file.cpp.gcov using the following code:gcov c:/path/to/file.gcda -o relative/path/to/source -b
gcov all of a sudden end up creating a file called ./relative#path#to#source#file.cpp.gcov What is the difference between running this on the command line and calling system? I know that perl will try and parse it through the command line if there is only 1 parameter.. however there is always more. at first I thought it was a gcov bug but I can run it manually.$gcov_error = system_no_output(1, $gcov_tool, $da_filename, "-o", $object_dir, "-b"); sub system_no_output($@) { my $mode = shift; my $result; local *OLD_STDERR; local *OLD_STDOUT; # Save old stdout and stderr handles ($mode & 1) && open(OLD_STDOUT, ">>&STDOUT"); ($mode & 2) && open(OLD_STDERR, ">>&STDERR"); # Redirect to /dev/null ($mode & 1) && open(STDOUT, ">/dev/null"); ($mode & 2) && open(STDERR, ">/dev/null"); system(@_); $result = $?; # Close redirected handles ($mode & 1) && close(STDOUT); ($mode & 2) && close(STDERR); # Restore old handles ($mode & 1) && open(STDOUT, ">>&OLD_STDOUT"); ($mode & 2) && open(STDERR, ">>&OLD_STDERR"); return $result; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system() Creating Different Results than Commandline Operation.
by BrowserUk (Patriarch) on Apr 06, 2009 at 17:05 UTC | |
by kazeits (Initiate) on Apr 06, 2009 at 18:14 UTC | |
by BrowserUk (Patriarch) on Apr 06, 2009 at 19:06 UTC | |
|
Re: system() Creating Different Results than Commandline Operation.
by ikegami (Patriarch) on Apr 06, 2009 at 17:09 UTC | |
|
Re: system() Creating Different Results than Commandline Operation.
by ikegami (Patriarch) on Apr 06, 2009 at 17:17 UTC | |
by kazeits (Initiate) on Apr 06, 2009 at 18:02 UTC | |
by ikegami (Patriarch) on Apr 06, 2009 at 18:12 UTC | |
|
Re: system() Creating Different Results than Commandline Operation.
by Anonymous Monk on Apr 06, 2009 at 17:09 UTC |