#include <wchar.h>
|
#include <dirent.h>
|
int
wclosedir (WDIR *dirp);
|
The wclosedir function returns 0 on success and on failure -1 is returned and the global variable errno is set to indicate the error..
The wclosedir function closes the named directory stream and frees the structure associated with the dirp pointer.
/** * Detailed description: This test code demonstrates usage of wclose system call. * * Preconditions: Expects Test directory to be present in current working directory. **/ #include <wchar.h> #include <dirent.h> int main() { WDIR *DirHandle; if(!(DirHandle = wopendir(L"Test") ) ) { printf("Failed to open directoy Test \n"); return -1; } if(wclosedir(DirHandle) < 0 ) { printf("Close dir failed \n"); return -1; } printf("Directory Test closed \n"); return 0; }
Output
Directory Test closed
[EBADF] | |
Invalid directory stream descriptor dir.
|
|
© 2005-2007 Nokia |