Name

wmkdir - creates a directory

Library

libc.lib

Synopsis

  #include <sys/types.h>
  #include <sys/stat.h>
  #include <wchar.h>
  int wmkdir (const wchar_t *path, mode_t mode);

Return values

The wmkdir() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

Detailed description

The directory with the wide character name path is created with the access permissions specified by mode.

Note: mode values will be ignored while directory creation.Default working directoy of a process is initalized to C: \private \UID (UID of the calling application), and any data written into this C: \private \UID directory persists between phone resets.

Limitation: Parent directory time stamps will not be updated with new directory creation.


Examples

#include <sys/stat.h>
#include <wchar.h>
#include <stdio.h>
int main()
{
  if(wmkdir(L"Example" , 0666) < 0 )  
  {
      printf("Directory creation failed \n");
      return -1;
  }
  printf("Directory Example created \n");
  return 0;
}

         

Output

Directory Example created

         


Errors

The wmkdir system call will fail and no directory will be created if:
[ENAMETOOLONG]
  A component of a pathname exceeded 255 characters.
[ENOENT]
  The named file does not exist.
[EINVAL]
  Invalid argument.
[EEXIST]
  File with the same name already exists.


See also

chmod, stat, umask, mkdir

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top