More of the helper functions - now for files.