only (re)create directory if given filename includes path