Name

wclosedir - closes the directory stream (directory with wide-character name)

Library

libc.lib

Synopsis

  #include <wchar.h>
  #include <dirent.h>
  int wclosedir (WDIR *dirp);


Return values

The wclosedir function returns 0 on success and on failure -1 is returned and the global variable errno is set to indicate the error..


Detailed description

The wclosedir function closes the named directory stream and frees the structure associated with the dirp pointer.



Examples

 /**
* 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

         


Errors

The wclosedir system call will fail if:
[EBADF]
  Invalid directory stream descriptor dir.



See also

wopendir, wreaddir, opendir, readdir,

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top