complete file sort function, use link list