fix #writeSortedItemsToFile in Linux