use the file_info() method to eliminate code duplication