export to a directory