Only prepend/append path if directory exists.