save_io_to_file check whether io and file is nil