filter files in a directory by extension