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=utf-8"> 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/chdrive.html"> 8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default"> 9<title>FatFs - f_chdrive</title> 10</head> 11 12<body> 13 14<div class="para func"> 15<h2>f_chdrive</h2> 16<p>The f_chdrive function changes the current drive.</p> 17<pre> 18FRESULT f_chdrive ( 19 const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Logical drive number */</span> 20); 21</pre> 22</div> 23 24<div class="para arg"> 25<h4>Parameters</h4> 26<dl class="par"> 27<dt>path</dt> 28<dd>Specifies the <a href="filename.html">logical drive number</a> to be set as the current drive.</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#id">FR_INVALID_DRIVE</a> 38</p> 39</div> 40 41 42<div class="para desc"> 43<h4>Description</h4> 44<p>The <tt>f_chdrive</tt> function changes only the current drive. The initial value of the current drive number is 0. In Unix style drive prefix configuration, this function will not be needed because <tt>f_chdir</tt> function changes also the current drive. Note that the current drive is retained in a static variable, so that it also affects other tasks that using the file functions.</p> 45</div> 46 47<div class="para comp"> 48<h4>QuickInfo</h4> 49<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> >= 1</tt>.</p> 50</div> 51 52 53<div class="para use"> 54<h4>Example</h4> 55<pre> 56 <em>f_chdrive</em>("2:"); <span class="c">/* Set drive 2 as current drive */</span> 57 58 <em>f_chdrive</em>(""); <span class="c">/* No effect (set current drive as current drive) */</span> 59</pre> 60</div> 61 62 63<div class="para ref"> 64<h4>See Also</h4> 65<p><tt><a href="chdir.html">f_chdir</a>, <a href="getcwd.html">f_getcwd</a></tt></p> 66</div> 67 68<p class="foot"><a href="../00index_e.html">Return</a></p> 69</body> 70</html> 71