in reply to Sorting files

A short snippet of the code that you are using ... in code-tags, as described in Markup in the Monastery ... would help us give you better answers.   Also, more details about the files:   how many files, and how large each?