diff options
-rw-r--r-- | src/list_events.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/list_events.c b/src/list_events.c index 67b27119..ffdcab80 100644 --- a/src/list_events.c +++ b/src/list_events.c @@ -72,6 +72,7 @@ int main(int argc, char *argv[]) FILE *ifh; FILE *ofh; DataTemplate *dtempl; + int err; /* Long options */ const struct option longopts[] = { @@ -132,6 +133,19 @@ int main(int argc, char *argv[]) return 1; } + if ( is_hdf5_file(input, &err) ) { + ERROR("Your input file appears to be an HDF5 file.\n"); + ERROR("The input file should be a list of data files, not the " + "data file itself.\n"); + ERROR("If you have only one input file, try the following:\n"); + ERROR(" echo %s > files.lst\n", input); + ERROR(" list_events -i files.lst -o %s -g %s ...\n", output, geom); + return 1; + } else if ( err ) { + ERROR("Couldn't open '%s'\n", input); + return 1; + } + ifh = fopen(input, "r"); if ( ifh == NULL ) { ERROR("Couldn't open '%s'\n", input); |