mkdir.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <meta http-equiv="Content-Style-Type" content="text/css">
  6. <link rel="up" title="FatFs" href="../00index_e.html">
  7. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  8. <title>FatFs - f_mkdir</title>
  9. </head>
  10. <body>
  11. <div class="para">
  12. <h2>f_mkdir</h2>
  13. <p>The f_mkdir function creates a new directory.</p>
  14. <pre>
  15. FRESULT f_mkdir (
  16. const char* <em>DirName</em> /* Pointer to the directory name */
  17. );
  18. </pre>
  19. </div>
  20. <div class="para">
  21. <h4>Parameter</h4>
  22. <dl class="par">
  23. <dt>DirName</dt>
  24. <dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to create. </dd>
  25. </dl>
  26. </div>
  27. <div class="para">
  28. <h4>Return Value</h4>
  29. <dl class="ret">
  30. <dt>FR_OK (0)</dt>
  31. <dd>The function succeeded.</dd>
  32. <dt>FR_NO_PATH</dt>
  33. <dd>Could not find the path.</dd>
  34. <dt>FR_INVALID_NAME</dt>
  35. <dd>The path name is invalid.</dd>
  36. <dt>FR_INVALID_DRIVE</dt>
  37. <dd>The drive number is invalid.</dd>
  38. <dt>FR_DENIED</dt>
  39. <dd>The directory cannot be created due to directory table or disk is full.</dd>
  40. <dt>FR_EXIST</dt>
  41. <dd>A file or directory that has same name is already existing.</dd>
  42. <dt>FR_NOT_READY</dt>
  43. <dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
  44. <dt>FR_WRITE_PROTECTED</dt>
  45. <dd>The medium is write protected.</dd>
  46. <dt>FR_RW_ERROR</dt>
  47. <dd>The function failed due to a disk error or an internal error.</dd>
  48. <dt>FR_NOT_ENABLED</dt>
  49. <dd>The logical drive has no work area.</dd>
  50. <dt>FR_NO_FILESYSTEM</dt>
  51. <dd>There is no valid FAT partition on the disk.</dd>
  52. </dl>
  53. </div>
  54. <div class="para">
  55. <h4>Description</h4>
  56. <p>The f_mkdir function creates a new directory. This function is not supported in read-only configuration and minimization level of &gt;= 1.</p>
  57. <p>
  58. </p>
  59. </div>
  60. <div class="para">
  61. <h4>Example</h4>
  62. <pre>
  63. res = f_mkdir("sub1");
  64. if (res) die(res);
  65. res = f_mkdir("sub1/sub2");
  66. if (res) die(res);
  67. res = f_mkdir("sub1/sub2/sub3");
  68. if (res) die(res);
  69. </pre>
  70. </div>
  71. <p class="foot"><a href="../00index_e.html">Return</a></p>
  72. </body>
  73. </html>