Obtains information about the next matching file using the attributes set by calling SetReaddirAttribute
#include <dirent.h>
DIR *readdir (
DIR *dirP);
(IN/OUT) Specifies the structure to receive information about the next matching file.
Returns a pointer to an object of the DIR structure type containing information about the next matching file or directory.
If an error occurs, such as when there are no more matching file names, NULL is returned and errno and NWErrno are set. (Unless NULL is returned, ignore values in errno and NWErrno.)
readdir can be called repeatedly to obtain the list of file and directory names contained in the directory specified by the path name given to the opendir function.
The closedir function must be called to close the directory and free the memory allocated by the opendir function.
The date and time fields are not in the DOS date/time format. It is easily put in the DOS format by swapping the high word with the low word.
Beginning with Release 9 of the NW SDK, readdir returns long names in the d_name field of the dirent structure if the target namespace is previously set to something other than DOS by calling SetTargetNameSpace. To have use of this long name functionality, you must compile with the dirent.h file included with Release 9 or later. In addition, with NetWare versions lower than 5, you might need CLIBAUX.NLM loaded on the server for symbol resolution. (Currently readdir support for spaces other than DOS is availible only on calls to the local server.)
NOTE:The position in the structure of the d_name field prior to Release 9 has been assumed by the new d_nameDOS field to ensure backward compatibility, and the d_name field has been moved to the end of the structure. The new code puts the DOS name space name at the d_nameDOS field offset so old code will still work. This can all be done with relative ease because CLIB allocates the memory.
NOTE:To have readdir return all files for the pattern *.* for the long name space, call UnAugmentAsterisk before calling opendir. See opendir or UnAugmentAsterisk for details.