CIfo: more safe file opening