#include <wchar.h>
|
#include <dirent.h>
|
void
wrewinddir (WDIR *dirp);
|
The wrewinddir function returns no value.
The wrewinddir function function resets the position of the named directory stream pointed by ‘dirp’ to the beginning of the directory.
/** * Detailed description: Sample usage of wreaddir call * Preconditions: Example Directory should be present in current working directory and should contain say 4 files/directories. **/ #include <dirent.h> #include <unistd.h> #include <wchar.h> int main() { WDIR *dirName; off_t offset; struct wdirent *Dir; dirName = wopendir(L"Example"); if(dirName == NULL ) { printf("Failed to open directory \n"); return -1; } wseekdir(dirName, 3) if((offset = wtelldir(dirName))!= 3) { printf("failed \n"); return -1; } wrewindir(dirName); if((offset = wtelldir(dirName))!= 0) { printf("failed \n"); return -1; } printf("Successful\n"); wclosedir(dirName); return 0; }
Output
Successful
© 2005-2007 Nokia |