list and process files and sub-dirs in a dir