lib: adds function to list files within a directory