]>
Commit | Line | Data |
---|---|---|
53668523 L |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r |
2 | <html lang="en">\r | |
3 | <head>\r | |
289f6a14 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r |
53668523 L |
5 | <meta http-equiv="Content-Style-Type" content="text/css">\r |
6 | <link rel="up" title="FatFs" href="../00index_e.html">\r | |
7 | <link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">\r | |
8 | <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r | |
9 | <title>FatFs - f_getlabel</title>\r | |
10 | </head>\r | |
11 | \r | |
12 | <body>\r | |
13 | \r | |
14 | <div class="para func">\r | |
15 | <h2>f_getlabel</h2>\r | |
289f6a14 | 16 | <p>The f_getlabel function returns volume label and volume serial number of a volume.</p>\r |
53668523 L |
17 | <pre>\r |
18 | FRESULT f_getlabel (\r | |
19 | const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Drive number */</span>\r | |
20 | TCHAR* <span class="arg">label</span>, <span class="c">/* [OUT] Volume label */</span>\r | |
21 | DWORD* <span class="arg">vsn</span> <span class="c">/* [OUT] Volume serial number */</span>\r | |
22 | );\r | |
23 | </pre>\r | |
24 | </div>\r | |
25 | \r | |
26 | <div class="para arg">\r | |
27 | <h4>Parameters</h4>\r | |
28 | <dl class="par">\r | |
29 | <dt>path</dt>\r | |
30 | <dd>Pointer to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. Null-string specifies the default drive.</dd>\r | |
31 | <dt>label</dt>\r | |
289f6a14 L |
32 | <dd>Pointer to the buffer to store the volume label. If the volume has no label, a null-string will be returned. Set null pointer if this information is not needed. The buffer size should be shown below at least to avoid buffer overflow.<br>\r |
33 | <table class="lst2">\r | |
34 | <tr><td>Configuration</td><td>FF_FS_EXFAT == 0</td><td>FF_FS_EXFAT == 1</td></tr>\r | |
35 | <tr><td>FF_USE_LFN == 0</td><td>12 items</td><td>-</td></tr>\r | |
36 | <tr><td>FF_LFN_UNICODE == 0</td><td>12 items</td><td>23 items</td></tr>\r | |
5630b930 | 37 | <tr><td>FF_LFN_UNICODE == 1,3</td><td>12 items</td><td>12 items</td></tr>\r |
289f6a14 L |
38 | <tr><td>FF_LFN_UNICODE == 2</td><td>34 items</td><td>34 items</td></tr>\r |
39 | </table>\r | |
40 | </dd>\r | |
53668523 L |
41 | <dt>vsn</dt>\r |
42 | <dd>Pointer to the <tt>DWORD</tt> variable to store the volume serial number. Set null pointer if this information is not needed.</dd>\r | |
43 | </dl>\r | |
44 | </div>\r | |
45 | \r | |
46 | \r | |
47 | <div class="para ret">\r | |
48 | <h4>Return Values</h4>\r | |
49 | <p>\r | |
50 | <a href="rc.html#ok">FR_OK</a>,\r | |
51 | <a href="rc.html#de">FR_DISK_ERR</a>,\r | |
52 | <a href="rc.html#ie">FR_INT_ERR</a>,\r | |
53 | <a href="rc.html#nr">FR_NOT_READY</a>,\r | |
54 | <a href="rc.html#id">FR_INVALID_DRIVE</a>,\r | |
55 | <a href="rc.html#ne">FR_NOT_ENABLED</a>,\r | |
56 | <a href="rc.html#ns">FR_NO_FILESYSTEM</a>,\r | |
57 | <a href="rc.html#tm">FR_TIMEOUT</a>\r | |
58 | </p>\r | |
59 | </div>\r | |
60 | \r | |
61 | \r | |
62 | <div class="para comp">\r | |
63 | <h4>QuickInfo</h4>\r | |
289f6a14 | 64 | <p>Available when <tt><a href="config.html#use_label">FF_USE_LABEL</a> == 1</tt>.</p>\r |
53668523 L |
65 | </div>\r |
66 | \r | |
67 | \r | |
68 | <div class="para use">\r | |
69 | <h4>Example</h4>\r | |
70 | <pre>\r | |
289f6a14 | 71 | char str[12];\r |
53668523 L |
72 | \r |
73 | <span class="c">/* Get volume label of the default drive */</span>\r | |
289f6a14 | 74 | <em>f_getlabel</em>("", str, 0);\r |
53668523 L |
75 | \r |
76 | <span class="c">/* Get volume label of the drive 2 */</span>\r | |
289f6a14 | 77 | <em>f_getlabel</em>("2:", str, 0);\r |
53668523 L |
78 | </pre>\r |
79 | </div>\r | |
80 | \r | |
81 | \r | |
82 | <div class="para ref">\r | |
83 | <h4>See Also</h4>\r | |
84 | <tt><a href="setlabel.html">f_setlabel</a></tt>\r | |
85 | </div>\r | |
86 | \r | |
87 | \r | |
88 | <p class="foot"><a href="../00index_e.html">Return</a></p>\r | |
89 | </body>\r | |
90 | </html>\r |