Penguin
Annotated edit history of mkdir(2) version 3, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
2 PerryLorier 2 mkdir - create a directory
1 perry 3
4 !!SYNOPSIS
2 PerryLorier 5 __#include <sys/stat.h>__
6 __#include <sys/types.h>__
7 __int mkdir(const char *__''pathname''__, mode_t__ ''mode''__);__
1 perry 8 !!DESCRIPTION
2 PerryLorier 9 mkdir(2) attempts to create a directory named ''pathname''.
1 perry 10
2 PerryLorier 11 ''mode'' specifies the permissions to use. It is modified by the process's umask(2) in the usual way: the permissions of the created file are __(mode __.
1 perry 12
13
2 PerryLorier 14 The newly created directory will be owned by the effective uid of the process. If the directory containing the file has the set group id bit set, or if the filesystem is mounted with BSD group semantics, the new directory will inherit the group ownership from its parent; otherwise it will be owned by the effective gid of the process.
1 perry 15
2 PerryLorier 16 If the parent directory has the set group id bit set then so will the newly created directory.
1 perry 17
18 !!RETURN VALUE
2 PerryLorier 19 mkdir(2) returns zero on success, or -1 if an error occurred (in which case, ''errno'' is set appropriately).
1 perry 20
21 !!ERRORS
2 PerryLorier 22 ;[EPERM]: The filesystem containing ''pathname'' does not support the creation of directories.
23 ;[EEXIST]: ''pathname'' already exists (not necessarily as a directory). This includes the case where ''pathname'' is a symbolic link, dangling or not.
24 ;[EFAULT]: ''pathname'' points outside your accessible address space.
25 ;[EACCES]: The parent directory does not allow write permission to the process, or one of the directories in ''pathname'' did not allow search (execute) permission.
26 ;[ENAMETOOLONG]: ''pathname'' was too long.
27 ;[ENOENT]: A directory component in ''pathname'' does not exist or is a dangling symbolic link.
28 ;[ENOTDIR]: A component used as a directory in ''pathname'' is not, in fact, a directory.
29 ;[ENOMEM]: Insufficient kernel memory was available.
30 ;[EROFS]: ''pathname'' refers to a file on a read-only filesystem.
31 ;[ELOOP]: Too many symbolic links were encountered in resolving ''pathname''.
32 ;[ENOSPC]: The device containing ''pathname'' has no room for the new directory.
33 ;[ENOSPC]: The new directory cannot be created because the user's disk quota is exhausted.
1 perry 34
35 !!CONFORMING TO
3 PerryLorier 36 SVr4, POSIX, BSD, SYSV, X/OPEN. SVr4 documents additional [EIO], [EMULTIHOP] and [ENOLINK] error conditions; POSIX.1 omits [ELOOP].
1 perry 37
2 PerryLorier 38 There are many infelicities in the protocol underlying [NFS]. Some of these affect mkdir(2).
1 perry 39 !!SEE ALSO
2 PerryLorier 40 mkdir(1), chmod(2), mknod(2), mount(2), rmdir(2), stat(2), umask(2), unlink(2)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 6 times)