sort ms and trees by filename