flatten directory