getlabel.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">
  8. <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
  9. <title>FatFs - f_getlabel</title>
  10. </head>
  11. <body>
  12. <div class="para func">
  13. <h2>f_getlabel</h2>
  14. <p>The f_getlabel function returns volume label and volume serial number of a drive.</p>
  15. <pre>
  16. FRESULT f_getlabel (
  17. const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Drive number */</span>
  18. TCHAR* <span class="arg">label</span>, <span class="c">/* [OUT] Volume label */</span>
  19. DWORD* <span class="arg">vsn</span> <span class="c">/* [OUT] Volume serial number */</span>
  20. );
  21. </pre>
  22. </div>
  23. <div class="para arg">
  24. <h4>Parameters</h4>
  25. <dl class="par">
  26. <dt>path</dt>
  27. <dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive.</dd>
  28. <dt>label</dt>
  29. <dd>Pointer to the buffer to store the volume label. The buffer size must be at least 12 items. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed.</dd>
  30. <dt>vsn</dt>
  31. <dd>Pointer to the <tt>DWORD</tt> variable to store the volume serial number. Set null pointer if this information is not needed.</dd>
  32. </dl>
  33. </div>
  34. <div class="para ret">
  35. <h4>Return Values</h4>
  36. <p>
  37. <a href="rc.html#ok">FR_OK</a>,
  38. <a href="rc.html#de">FR_DISK_ERR</a>,
  39. <a href="rc.html#ie">FR_INT_ERR</a>,
  40. <a href="rc.html#nr">FR_NOT_READY</a>,
  41. <a href="rc.html#id">FR_INVALID_DRIVE</a>,
  42. <a href="rc.html#ne">FR_NOT_ENABLED</a>,
  43. <a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
  44. <a href="rc.html#tm">FR_TIMEOUT</a>
  45. </p>
  46. </div>
  47. <div class="para comp">
  48. <h4>QuickInfo</h4>
  49. <p>Available when <tt>_USE_LABEL == 1</tt>.</p>
  50. </div>
  51. <div class="para use">
  52. <h4>Example</h4>
  53. <pre>
  54. char str[12];
  55. <span class="c">/* Get volume label of the default drive */</span>
  56. f_getlabel("", str, 0);
  57. <span class="c">/* Get volume label of the drive 2 */</span>
  58. f_getlabel("2:", str, 0);
  59. </pre>
  60. </div>
  61. <div class="para ref">
  62. <h4>See Also</h4>
  63. <tt><a href="setlabel.html">f_setlabel</a></tt>
  64. </div>
  65. <p class="foot"><a href="../00index_e.html">Return</a></p>
  66. </body>
  67. </html>