#include <sys/types.h>
|
#include <sys/stat.h>
|
|
int
mkdir (const char *path, mode_t mode); |
Note: mode values will be ignored while directory creation.Default working directory of a process is initialized to C: rivate ID (UID of the calling application), and any data written into this C: rivate ID directory persists between phone resets.
Limitation: Parent directory time stamps will not be updated with new directory creation, created directory will be empty(i.e., it doesn’t have "." and ".." entries)
/**
* Detailed description : This test code demonstrates usage of mkdir systemcall, it creates function
* a directory Example in current working directory.
**/
int main()
{
if(mkdir("Example" , 0666) < 0 )
{
printf("Directory creation failed \n");
return -1;
}
printf("Directory Example created \n");
return 0;
}
Output
Directory Example created
| [ENOTDIR] | |
| A component of the path prefix is not a directory.(Not supported). | |
| [ENAMETOOLONG] | |
| A component or an entire path name exceeded 255 characters. | |
| [ENOENT] | |
| A component of the path prefix does not exist. | |
| [EACCES] | |
| Search permission is denied for a component of the path prefix, or write permission is denied on the parent directory of the directory to be created(Not supported). | |
| [ELOOP] | |
| Too many symbolic links were encountered in translating the pathname( Not supported). | |
| [EROFS] | |
| The named file resides on a read-only file system(Not supported). | |
| [EEXIST] | |
| The named file exists. | |
| [ENOSPC] | |
| The new directory cannot be created because there is no space left on the file system that will contain the directory(Not supported). | |
| [ENOSPC] | |
| There are no free inodes on the file system on which the directory is being created(Not supported). | |
| [EDQUOT] | |
| The new directory cannot be created because the user’s quota of disk blocks on the file system that will contain the directory has been exhausted(Not supported). | |
| [EDQUOT] | |
| The user’s quota of inodes on the file system on which the directory is being created has been exhausted(Not supported). | |
| [EIO] | An I/O error occurred while making the directory entry or allocating the inode(Not supported). |
| [EIO] | An I/O error occurred while reading from or writing to the file system(Not supported). |
| [EFAULT] | |
| The path argument points outside the process’s allocated address space(Not supported). | |
|
© 2005-2007 Nokia |