Commit d0d952d8 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Make use of stream output for createtable.

parent 9eb32773
......@@ -4,8 +4,10 @@
#include <string.h>
#include "cdi.h"
#include "error.h"
static char *Progname;
extern int CDI_Debug;
void version(void)
{
......@@ -98,8 +100,11 @@ int main(int argc, char *argv[])
if ( debug ) cdiDebug(debug);
*/
tableID = tableRead(ifile);
if ( CDI_Debug )
Message("write parameter table %d to %s", tableID, ofile);
FILE *ptfp = (ofile[0] == '-' && ofile[1] == '\0')?stdout:fopen(ofile, "w");
if ( tableID != CDI_UNDEFID )
tableWriteC(ofile, tableID);
tableFWriteC(ptfp, tableID);
return EXIT_SUCCESS;
}
......
......@@ -40,8 +40,7 @@ EOF
for TFILE in $PTFILES; do
echo "process: $TFILE"
rm -f ptfile
../app/createtable $TFILE ptfile
cat ptfile >> $OFILE
../app/createtable "$TFILE" - >>"$OFILE"
done
#
cat >> $OFILE <<EOF
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment