CephFS returns Linux-style struct dirent that has a d_type field.
It appears to properly make use of the field. This change exposes
the field using a DType type and associated constants as well
as a DType() function for the DirEntry.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
The RewindDir is used by List and can be used independently. It
resets the open dir to the "start".
The List function and the accompanying DirEntries type allow one
to simply grab all the dir entries at once. The Names method on the
DirEntries type allows the user to get the most commonly wanted items
from the dir entries in one shot.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add the Directory type and the OpenDir function to get an open
Directory and a Close function to close/free it.
Signed-off-by: John Mulligan <jmulligan@redhat.com>