Index: tables.c =================================================================== --- tables.c (revision 54029) +++ tables.c (working copy) @@ -415,6 +415,8 @@ (void)fclose(tabptr); } else { int ret; + FILE *outFile; + struct bu_mapped_file *inFile; fprintf(tabptr, "* 9999999\n* 9999999\n* 9999999\n* 9999999\n* 9999999\n"); (void)fclose(tabptr); @@ -434,15 +436,22 @@ bu_log("WARNING: sort failure detected\n"); } bu_vls_printf(gedp->ged_result_str, "%V\n", &cmd); - - bu_vls_trunc(&cmd, 0); - bu_vls_strcpy(&cmd, catcmd); - bu_vls_strcat(&cmd, argv[1]); - bu_vls_printf(gedp->ged_result_str, "%V\n", &cmd); - ret = system(bu_vls_addr(&cmd)); - if (ret != 0) - bu_log("WARNING: cat failure detected\n"); - + inFile = bu_open_mapped_file(argv[1], (char *)NULL); + if (!inFile) { + bu_vls_printf(gedp->ged_result_str, "Cannot open temporary file %s\n", argv[1]); + return GED_ERROR; + } + outFile = fopen("/tmp/ord_id\0", "a"); + if (!outFile) { + bu_vls_printf(gedp->ged_result_str, "Cannot open temporary file %s\n", "/tmp/ord_id"); + return GED_ERROR; + } + currptr = (const char *)(inFile->buf); + for (i = 0; i < inFile->buflen; i++) { + fputc(*(currptr + i),outFile); + } + bu_close_mapped_file(inFile); + fclose(outFile); bu_file_delete("/tmp/ord_id\0"); }