file_or_string function.