mkdir.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <html>
  2. <head>
  3. <title>mkdir</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>mkdir</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. mkdir - create directory
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;sys/stat.h&gt;<br>
  13. <br>
  14. int<br>
  15. mkdir(const char *<em>pathname</em>, int <em>mode</em>);
  16. <h3>Description</h3>
  17. mkdir creates a directory named <em>name</em>, where <em>name</em> is
  18. the last filename component in <em>pathname</em>. All the directories
  19. named in the prefix portion of <em>pathname</em> must exist and must
  20. in fact be directories, not ordinary files. The name <em>name</em>
  21. must not already exist. The new directory must be created atomically.
  22. <p>
  23. The <em>mode</em> argument can be ignored in OS/161.
  24. <p>
  25. <h3>Return Values</h3>
  26. On success, mkdir returns 0. On error, -1 is returned, and
  27. <A HREF=errno.html>errno</A> is set according to the error
  28. encountered.
  29. <h3>Errors</h3>
  30. The following error codes should be returned under the conditions
  31. given. Other error codes may be returned for other errors not
  32. mentioned here.
  33. <blockquote><table width=90%>
  34. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  35. <tr><td>ENODEV</td> <td>The device prefix of <em>pathname</em> did
  36. not exist.</td></tr>
  37. <tr><td>ENOTDIR</td> <td>A non-final component of <em>pathname</em>
  38. was not a directory.</td></tr>
  39. <tr><td>ENOENT</td> <td>A non-final component of <em>pathname</em>
  40. did not exist.</td></tr>
  41. <tr><td>EEXIST</td> <td>An object by the name <em>pathname</em>
  42. already exists.</td></tr>
  43. <tr><td>ENOSPC</td> <td>The filesystem the directory was to be
  44. created on is full.</td></tr>
  45. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  46. <tr><td>EFAULT</td> <td><em>pathname</em> was an invalid pointer.</td></tr>
  47. </table></blockquote>
  48. </body>
  49. </html>