sorting with specified temporary directory