Flatten a directory structure