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