This is highly system specific, for a Unix way,
this thread might shed some light into what you should use, the use of the
d_name will provide the name of the file/directory, but since you want this to be some form of directory handling, then you might want to check for the
d_type provided in that structure in order to determain if it's a file or a directory.
Else look at your systems provided opendir()/readdir()/chdir()/mkdir()/closedir() equivalent functions.