process files and subfolders in sorted order