Adding set_filename and set_mode to file.