Better way to parse filename/dirname in config file