way to flatten dirpaths