Map function for files