I have an executable that, depending on its input, outputs to either one file or several. It usually prints nothing on screen. The usual way to call this program is to specify an input and output filenames, like this:
Code:
./executable.exe -i inputfile -o outputfile
It will then try to use the output filename exactly if it needs to output to one file, or it will start appending -01, -02, -03, -04 etc... to the name and create as many outputs as needed otherwise. (These are not a combination of output and error files, they are all output files only)
I want to force output everything from it on screen. If I change my code to:
Code:
./executable.exe -i inputfile -o /dev/stdout
then it will only work if the program wants to create one output file. But I get the error
Code:
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::insert
Abort
in case it wants to output to several files. Is there another trick to
force all outputs from it to print on screen??
Thanks