flatten directory tree