]> cloudbase.mooo.com Git - z180-stamp.git/blob - fatfs/doc/en/setlabel.html
Import fatfs R0.12b
[z180-stamp.git] / fatfs / doc / en / setlabel.html
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/setlabel.html">
8 <link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
9 <title>FatFs - f_setlabel</title>
10 </head>
11
12 <body>
13
14 <div class="para func">
15 <h2>f_setlabel</h2>
16 <p>The f_setlabel function sets/removes the label of a volume.</p>
17 <pre>
18 FRESULT f_setlabel (
19 const TCHAR* <span class="arg">label</span> <span class="c">/* [IN] Volume label to be set */</span>
20 );
21 </pre>
22 </div>
23
24 <div class="para arg">
25 <h4>Parameters</h4>
26 <dl class="par">
27 <dt>label</dt>
28 <dd>Pointer to the null-terminated string that specifies the volume label to be set.</dd>
29 </dl>
30 </div>
31
32
33 <div class="para ret">
34 <h4>Return Values</h4>
35 <p>
36 <a href="rc.html#ok">FR_OK</a>,
37 <a href="rc.html#de">FR_DISK_ERR</a>,
38 <a href="rc.html#ie">FR_INT_ERR</a>,
39 <a href="rc.html#nr">FR_NOT_READY</a>,
40 <a href="rc.html#in">FR_INVALID_NAME</a>,
41 <a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
42 <a href="rc.html#id">FR_INVALID_DRIVE</a>,
43 <a href="rc.html#ne">FR_NOT_ENABLED</a>,
44 <a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
45 <a href="rc.html#tm">FR_TIMEOUT</a>
46 </p>
47 </div>
48
49
50 <div class="para desc">
51 <h4>Description</h4>
52 <p>When the string has a drive number, the volume label will be set to the volume specified by the drive number. If not, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label on the FAT volume is similar to the file name but there are some differences shown below:</p>
53 <ul>
54 <li>Spaces can be contained anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>
55 <li>Period is not allowed.</li>
56 <li>Up to 11 bytes long as conversion of OEM code page at FAT volume.</li>
57 <li>Up to 11 characters long at exFAT volume. Case information is preserved.</li>
58 </ul>
59 <p>Remark: The standard system (Windows) has a problem at handling of the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
60 </div>
61
62 <div class="para comp">
63 <h4>QuickInfo</h4>
64 <p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_LABEL == 1</tt>.</p>
65 </div>
66
67
68 <div class="para use">
69 <h4>Example</h4>
70 <pre>
71 <span class="c">/* Set volume label to the default drive */</span>
72 f_setlabel("DATA DISK");
73
74 <span class="c">/* Set volume label to the drive 2 */</span>
75 f_setlabel("2:DISK 3 OF 4");
76
77 <span class="c">/* Remove volume label of the drive 2 */</span>
78 f_setlabel("2:");
79 </pre>
80 </div>
81
82
83 <div class="para ref">
84 <h4>See Also</h4>
85 <tt><a href="getlabel.html">f_getlabel</a></tt>
86 </div>
87
88
89 <p class="foot"><a href="../00index_e.html">Return</a></p>
90 </body>
91 </html>