rose.config: improve file object detection logic.