Modify the interface of sortFile function