]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/documents/doc/setlabel.html
Import fatfs R0.13b
[z180-stamp.git] / fatfs / documents / doc / setlabel.html
CommitLineData
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/setlabel.html">\r
8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
9<title>FatFs - f_setlabel</title>\r
10</head>\r
11\r
12<body>\r
13\r
14<div class="para func">\r
15<h2>f_setlabel</h2>\r
16<p>The f_setlabel function sets/removes the label of a volume.</p>\r
17<pre>\r
18FRESULT f_setlabel (\r
19 const TCHAR* <span class="arg">label</span> <span class="c">/* [IN] Volume label to be set */</span>\r
20);\r
21</pre>\r
22</div>\r
23\r
24<div class="para arg">\r
25<h4>Parameters</h4>\r
26<dl class="par">\r
27<dt>label</dt>\r
28<dd>Pointer to the null-terminated string that specifies the volume label to be set.</dd>\r
29</dl>\r
30</div>\r
31\r
32\r
33<div class="para ret">\r
34<h4>Return Values</h4>\r
35<p>\r
36<a href="rc.html#ok">FR_OK</a>,\r
37<a href="rc.html#de">FR_DISK_ERR</a>,\r
38<a href="rc.html#ie">FR_INT_ERR</a>,\r
39<a href="rc.html#nr">FR_NOT_READY</a>,\r
40<a href="rc.html#in">FR_INVALID_NAME</a>,\r
41<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,\r
42<a href="rc.html#id">FR_INVALID_DRIVE</a>,\r
43<a href="rc.html#ne">FR_NOT_ENABLED</a>,\r
44<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,\r
45<a href="rc.html#tm">FR_TIMEOUT</a>\r
46</p>\r
47</div>\r
48\r
49\r
50<div class="para desc">\r
51<h4>Description</h4>\r
289f6a14 52<p>When the string has a drive prefix, the volume label will be set to the volume specified by the drive prefix. Unix style volume ID cannot be used to specify the volume. If drive number is not specified, 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 is as shown below:</p>\r
53668523 53<ul>\r
70702af1 54<li>Up to 11 bytes long as conversion of OEM code page at FAT volume.</li>\r
289f6a14
L
55<li>Up to 11 characters long at exFAT volume.</li>\r
56<li>Allowable characters for FAT volume are: <tt>! # $ % &amp; ' ( ) - ^ _ ` ~ { } 0-9 A-Z a-z</tt> and extended characters. Low-case characters are up converted.</li>\r
57<li>Allowable characters for exFAT volume are: characters allowed for FAT volume and <tt>" + , . ; = [ ]</tt>. Low-case characters are preserved.</li>\r
58<li>Spaces can be contained anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>\r
53668523 59</ul>\r
289f6a14 60<p>Remark: The standard system (Windows) has a problem at 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>\r
53668523
L
61</div>\r
62\r
63<div class="para comp">\r
64<h4>QuickInfo</h4>\r
289f6a14 65<p>Available when <tt><a href="config.html#fs_readonly">FF_FS_READONLY</a> == 0</tt> and <tt><a href="config.html#use_label">FF_USE_LABEL</a> == 1</tt>.</p>\r
53668523
L
66</div>\r
67\r
68\r
69<div class="para use">\r
70<h4>Example</h4>\r
71<pre>\r
72 <span class="c">/* Set volume label to the default drive */</span>\r
289f6a14 73 <em>f_setlabel</em>("DATA DISK");\r
53668523
L
74\r
75 <span class="c">/* Set volume label to the drive 2 */</span>\r
289f6a14 76 <em>f_setlabel</em>("2:DISK 3 OF 4");\r
53668523
L
77\r
78 <span class="c">/* Remove volume label of the drive 2 */</span>\r
289f6a14 79 <em>f_setlabel</em>("2:");\r
53668523
L
80</pre>\r
81</div>\r
82\r
83\r
84<div class="para ref">\r
85<h4>See Also</h4>\r
86<tt><a href="getlabel.html">f_getlabel</a></tt>\r
87</div>\r
88\r
89\r
90<p class="foot"><a href="../00index_e.html">Return</a></p>\r
91</body>\r
92</html>\r