Flatten a directory hierachy and puts it into a single folder.