Tools: Comments
@@ -260,6 +260,9 @@ int grib_tool_init(grib_runtime_options* options)
const char* filename[1];
filename[0] = options->infile_extra->name; /* First file */
options->random = 1;
+ /* Setting 'orderby' will cause the second file to also be read as a sorted fieldset
+ * See file: grib_tool.c function: grib_tool
+ */
options->orderby = strdup(orderby);
options->idx = grib_fieldset_new_from_files(context, filename,
nfiles, 0, 0, 0, orderby, &ret);
@@ -1145,6 +1148,14 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
} */
}
+#if 0
+ {
+ long of1,of2; /* Debugging: print offset of each handle */
+ grib_get_long(h1, "offset", &of1); grib_get_long(h2, "offset", &of2);
+ printf("of1=%lu of2=%lu\n",of1,of2);
+ }
+#endif
+
if (headerMode) {
const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0;
