Issue #2216767 by Mark Carver: Create _bootstrap_file_scan_directory() helper function to cache results.