get the data from a directory