logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

mkdir.1p (7487B)


  1. '\" et
  2. .TH MKDIR "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. mkdir
  12. \(em make directories
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. mkdir \fB[\fR-p\fB] [\fR-m \fImode\fB] \fIdir\fR...
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR mkdir
  21. utility shall create the directories specified by the operands, in the
  22. order specified.
  23. .P
  24. For each
  25. .IR dir
  26. operand, the
  27. .IR mkdir
  28. utility shall perform actions equivalent to the
  29. \fImkdir\fR()
  30. function defined in the System Interfaces volume of POSIX.1\(hy2017, called with the following arguments:
  31. .IP " 1." 4
  32. The
  33. .IR dir
  34. operand is used as the
  35. .IR path
  36. argument.
  37. .IP " 2." 4
  38. The value of the bitwise-inclusive OR of S_IRWXU, S_IRWXG, and S_IRWXO
  39. is used as the
  40. .IR mode
  41. argument. (If the
  42. .BR \-m
  43. option is specified, the value of the
  44. \fImkdir\fR()
  45. .IR mode
  46. argument is unspecified, but the directory shall at no time
  47. have permissions less restrictive than the
  48. .BR \-m
  49. .IR mode
  50. option-argument.)
  51. .SH OPTIONS
  52. The
  53. .IR mkdir
  54. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  55. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  56. .P
  57. The following options shall be supported:
  58. .IP "\fB\-m\ \fImode\fR" 10
  59. Set the file permission bits of the newly-created directory to the
  60. specified
  61. .IR mode
  62. value. The
  63. .IR mode
  64. option-argument shall be the same as the
  65. .IR mode
  66. operand defined for the
  67. .IR chmod
  68. utility. In the
  69. .IR symbolic_mode
  70. strings, the
  71. .IR op
  72. characters
  73. .BR '\(pl'
  74. and
  75. .BR '\-'
  76. shall be interpreted relative to an assumed initial mode of
  77. .IR a =\c
  78. .IR rwx ;
  79. .BR '\(pl'
  80. shall add permissions to the default mode,
  81. .BR '\-'
  82. shall delete permissions from the default mode.
  83. .IP "\fB\-p\fP" 10
  84. Create any missing intermediate pathname components.
  85. .RS 10
  86. .P
  87. For each
  88. .IR dir
  89. operand that does not name an existing directory, before performing the
  90. actions described in the DESCRIPTION above, the
  91. .IR mkdir
  92. utility shall create any pathname components of the path prefix of
  93. .IR dir
  94. that do not name an existing directory by performing actions equivalent
  95. to first calling the
  96. \fImkdir\fR()
  97. function with the following arguments:
  98. .IP " 1." 4
  99. A pathname naming the missing pathname component, ending with a trailing
  100. <slash>
  101. character, as the
  102. .IR path
  103. argument
  104. .IP " 2." 4
  105. The value zero as the
  106. .IR mode
  107. argument
  108. .P
  109. and then calling the
  110. \fIchmod\fR()
  111. function with the following arguments:
  112. .IP " 1." 4
  113. The same
  114. .IR path
  115. argument as in the
  116. \fImkdir\fR()
  117. call
  118. .IP " 2." 4
  119. The value
  120. .IR "(S_IWUSR|S_IXUSR|\(ti\fIfilemask\fP)&0777" \fR
  121. as the
  122. .IR mode
  123. argument, where
  124. .IR filemask
  125. is the file mode creation mask of the process (see the System Interfaces volume of POSIX.1\(hy2017,
  126. .IR "\fIumask\fR\^(\|)")
  127. .P
  128. Each
  129. .IR dir
  130. operand that names an existing directory shall be ignored without
  131. error.
  132. .RE
  133. .SH OPERANDS
  134. The following operand shall be supported:
  135. .IP "\fIdir\fR" 10
  136. A pathname of a directory to be created.
  137. .SH STDIN
  138. Not used.
  139. .SH "INPUT FILES"
  140. None.
  141. .SH "ENVIRONMENT VARIABLES"
  142. The following environment variables shall affect the execution of
  143. .IR mkdir :
  144. .IP "\fILANG\fP" 10
  145. Provide a default value for the internationalization variables that are
  146. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  147. .IR "Section 8.2" ", " "Internationalization Variables"
  148. for the precedence of internationalization variables used to determine
  149. the values of locale categories.)
  150. .IP "\fILC_ALL\fP" 10
  151. If set to a non-empty string value, override the values of all the
  152. other internationalization variables.
  153. .IP "\fILC_CTYPE\fP" 10
  154. Determine the locale for the interpretation of sequences of bytes of
  155. text data as characters (for example, single-byte as opposed to
  156. multi-byte characters in arguments).
  157. .IP "\fILC_MESSAGES\fP" 10
  158. .br
  159. Determine the locale that should be used to affect the format and
  160. contents of diagnostic messages written to standard error.
  161. .IP "\fINLSPATH\fP" 10
  162. Determine the location of message catalogs for the processing of
  163. .IR LC_MESSAGES .
  164. .SH "ASYNCHRONOUS EVENTS"
  165. Default.
  166. .SH STDOUT
  167. Not used.
  168. .SH STDERR
  169. The standard error shall be used only for diagnostic messages.
  170. .SH "OUTPUT FILES"
  171. None.
  172. .SH "EXTENDED DESCRIPTION"
  173. None.
  174. .SH "EXIT STATUS"
  175. The following exit values shall be returned:
  176. .IP "\00" 6
  177. All the specified directories were created successfully, or the
  178. .BR \-p
  179. option was specified and all the specified directories either already
  180. existed or were created successfully.
  181. .IP >0 6
  182. An error occurred.
  183. .SH "CONSEQUENCES OF ERRORS"
  184. Default.
  185. .LP
  186. .IR "The following sections are informative."
  187. .SH "APPLICATION USAGE"
  188. The default file mode for directories is
  189. .IR a =\c
  190. .IR rwx
  191. (777 on most systems) with selected permissions removed in accordance
  192. with the file mode creation mask. For intermediate pathname components
  193. created by
  194. .IR mkdir ,
  195. the mode is the default modified by
  196. .IR u +\c
  197. .IR wx
  198. so that the subdirectories can always be created regardless of the file
  199. mode creation mask; if different ultimate permissions are desired for
  200. the intermediate directories, they can be changed afterwards with
  201. .IR chmod .
  202. .P
  203. Note that some of the requested directories may have been created even
  204. if an error occurs.
  205. .SH EXAMPLES
  206. None.
  207. .SH RATIONALE
  208. The System V
  209. .BR \-m
  210. option was included to control the file mode.
  211. .P
  212. The System V
  213. .BR \-p
  214. option was included to create any needed intermediate directories and
  215. to complement the functionality provided by
  216. .IR rmdir
  217. for removing directories in the path prefix as they become empty.
  218. Because no error is produced if any path component already exists, the
  219. .BR \-p
  220. option is also useful to ensure that a particular directory exists.
  221. .P
  222. The functionality of
  223. .IR mkdir
  224. is described substantially through a reference to the
  225. \fImkdir\fR()
  226. function in the System Interfaces volume of POSIX.1\(hy2017. For example, by default, the mode of the
  227. directory is affected by the file mode creation mask in accordance with
  228. the specified behavior of the
  229. \fImkdir\fR()
  230. function. In this way, there is less duplication of effort required for
  231. describing details of the directory creation.
  232. .SH "FUTURE DIRECTIONS"
  233. None.
  234. .SH "SEE ALSO"
  235. .IR "\fIchmod\fR\^",
  236. .IR "\fIrm\fR\^",
  237. .IR "\fIrmdir\fR\^",
  238. .IR "\fIumask\fR\^"
  239. .P
  240. The Base Definitions volume of POSIX.1\(hy2017,
  241. .IR "Chapter 8" ", " "Environment Variables",
  242. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  243. .P
  244. The System Interfaces volume of POSIX.1\(hy2017,
  245. .IR "\fImkdir\fR\^(\|)",
  246. .IR "\fIumask\fR\^(\|)"
  247. .\"
  248. .SH COPYRIGHT
  249. Portions of this text are reprinted and reproduced in electronic form
  250. from IEEE Std 1003.1-2017, Standard for Information Technology
  251. -- Portable Operating System Interface (POSIX), The Open Group Base
  252. Specifications Issue 7, 2018 Edition,
  253. Copyright (C) 2018 by the Institute of
  254. Electrical and Electronics Engineers, Inc and The Open Group.
  255. In the event of any discrepancy between this version and the original IEEE and
  256. The Open Group Standard, the original IEEE and The Open Group Standard
  257. is the referee document. The original Standard can be obtained online at
  258. http://www.opengroup.org/unix/online.html .
  259. .PP
  260. Any typographical or formatting errors that appear
  261. in this page are most likely
  262. to have been introduced during the conversion of the source files to
  263. man page format. To report such errors, see
  264. https://www.kernel.org/doc/man-pages/reporting_bugs.html .