diff options
author | Thomas White <taw@physics.org> | 2023-05-05 11:56:41 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-05-05 11:56:41 +0200 |
commit | 23d182d7c0d0c9ffd4a5f6189d6c05fe964a5d96 (patch) | |
tree | 75795a080c069b312d39dde83f975264adc2afe9 /src | |
parent | d8e17d6154ce644449ad5979eb6846e9e9816f6e (diff) |
list_events: Catch common error '-i input.h5'
Diffstat (limited to 'src')
-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); |