use BUF_SIZE instead of 512 for buf
add struct dirent