Is file a file-like object, or a path to a file?