Skip to content

Commit

Permalink
Per #1508, refine logic further to handle lists with length > 10.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Oct 14, 2020
1 parent c2eb895 commit 47afcc0
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions met/src/libcode/vx_data2d_factory/parse_file_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,30 +165,38 @@ while(f_in >> file_name) {

//
// Keep track of the number of missing files.
// After too many missing files, assume this is not a file list
// and return an empty list.
//

if ( check_files_exist ) {

if ( !is_regular_file(file_name.c_str()) ) n_missing++;

if ( n_missing >= max_missing ) {
if ( n_missing >= max_missing ) break;

mlog << Debug(5) << "parse_ascii_file_list() -> "
<< "File \"" << path << "\" is not an ASCII file list "
<< "since there are too many missing files.\n";
}
}

//
// Check for too many missing files:
// - A small number of files that are all missing
// - A large number of files with a least 10 missing
//

a.clear();
if ( check_files_exist ) {

break;
}
if ( ( a.n() < max_missing && n_missing == a.n() ) ||
( a.n() >= max_missing && n_missing >= max_missing ) ) {

mlog << Debug(5) << "parse_ascii_file_list() -> "
<< "File \"" << path << "\" is not an ASCII file list "
<< "since there are too many missing files.\n";

a.clear();
}
}

f_in.close();


return(a);

}
Expand Down

0 comments on commit 47afcc0

Please sign in to comment.