Tallies files by type in a specified directory