summaryrefslogtreecommitdiff
path: root/reference/C/MAN/mkdir.htm
blob: 7ac0bc9da7439882b5ee2bbc192fff1e2a342413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<TITLE>mkdir</TITLE>
<body bgcolor="#ffffcc">
<hr>
<pre>



<h3>MKDIR(2)            Linux Programmer's Manual            MKDIR(2)
</h3>

<h3>NAME
</h3>       mkdir - create a directory

<h3>SYNOPSIS
</h3>       #include &lt;sys/types.h&gt;
       #include &lt;fcntl.h&gt;
       #include &lt;unistd.h&gt;

       int mkdir(const char *pathname, mode_t mode);

<h3>DESCRIPTION
</h3>       mkdir attempts to create a directory named pathname.

       mode  specifies  the permissions to use. It is modified by
       the process's umask in the usual way: the  permissions  of
       the created file are (mode & ~umask).

       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.

       If the parent directory has the set group id bit set  then
       so will the newly created directory.


<h3>RETURN VALUE
</h3>       mkdir  returns zero on success, or -1 if an error occurred
       (in which case, errno is set appropriately).

<h3>ERRORS
</h3>       EEXIST pathname  already  exists  (not  necessarily  as  a
              directory).

       EFAULT pathname  points  outside  your  accessible address
              space.

       EACCES The parent directory does not allow  write  permis-
              sion  to  the process, or one of the directories in
              pathname did not allow search (execute) permission.

       ENAMETOOLONG
              pathname was too long.

       ENOENT A directory component in pathname does not exist or
              is a dangling symbolic link.

       ENOTDIR
              A component used as a directory in pathname is not,
              in fact, a directory.

       ENOMEM Insufficient kernel memory was available.



<h3>Linux 1.0                 29 March 1994                         1
</h3>




<h3>MKDIR(2)            Linux Programmer's Manual            MKDIR(2)
</h3>

       EROFS  pathname refers to a file on a read-only filesystem
              and write access was requested.

       ELOOP  pathname contains a reference to  a  circular  sym-
              bolic link, ie a symbolic link whose expansion con-
              tains a reference to itself.

       ENOSPC The device containing pathname has no room for  the
              new  directory.  ENOSPC The new directory cannot be
              created because the user's disk quota is exhausted.

<h3>CONFORMING TO
</h3><h3>BUGS
</h3>       In some older versions of Linux (for example, 0.99pl7) all
       the normal filesystems sometime allow the creation of  two
       files  in  the  same  directory  with the same name.  This
       occurs only rarely and only on a  heavily  loaded  system.
       It  is  believed  that  this  bug  was  fixed in the Minix
       filesystem in Linux 0.99pl8 pre-release; and it  is  hoped
       that  it was fixed in the other filesystems shortly after-
       wards.

       There are many infelicities  in  the  protocol  underlying
       NFS.

</pre>
<hr>
<h3>SEE ALSO
</h3><p>
<a href=read.htm>read</a>, 
<a href=write.htm>write</a>, 
<a href=fcntl.htm>fcntl</a>, 
<a href=close.htm>close</a>, 
<a href=unlink.htm>unlink</a>, 
<a href=open.htm>open</a>, 
<a href=mknod.htm>mknod</a>, 
<a href=stat.htm>stat</a>, 
<a href=umask.htm>umask</a>, 
<a href=mount.htm>mount</a>, 
<a href=socket.htm>socket</a>, 
<a href=socket.htm>socket</a>, 
<pre>




























<h3>Linux 1.0                 29 March 1994                         2
</h3>


</pre>
<P>
<hr>
<p>
<center>
<table border=2 width=80%>
<tr align=center>
<td width=25%>
<a href=../cref.html>Top</a>
</td><td width=25%>
<a href=../master_index.html>Master Index</a>
</td><td width=25%>
<a href=../SYNTAX/keywords.html>Keywords</a>
</td><td width=25%>
<a href=../FUNCTIONS/funcref.htm>Functions</a>
</td>
</tr>
</table>
</center>
<p>
<hr>

This manual page was brought to you by <i>mjl_man V-2.0</i>