utility function for files