1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
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>
14 <div class=
"para func">
16 <p>The f_chdrive function changes the current drive.
</p>
19 const TCHAR*
<span class=
"arg">path
</span> <span class=
"c">/* [IN] Logical drive number */
</span>
24 <div class=
"para arg">
28 <dd>Specifies the
<a href=
"filename.html">logical drive number
</a> to be set as the current drive.
</dd>
33 <div class=
"para ret">
34 <h4>Return Values
</h4>
36 <a href=
"rc.html#ok">FR_OK
</a>,
37 <a href=
"rc.html#id">FR_INVALID_DRIVE
</a>
42 <div class=
"para desc">
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>
47 <div class=
"para comp">
49 <p>Available when
<tt><a href=
"config.html#fs_rpath">FF_FS_RPATH
</a> >=
1</tt>.
</p>
53 <div class=
"para use">
56 <em>f_chdrive
</em>(
"2:");
<span class=
"c">/* Set drive
2 as current drive */
</span>
58 <em>f_chdrive
</em>(
"");
<span class=
"c">/* No effect (set current drive as current drive) */
</span>
63 <div class=
"para ref">
65 <p><tt><a href=
"chdir.html">f_chdir
</a>,
<a href=
"getcwd.html">f_getcwd
</a></tt></p>
68 <p class=
"foot"><a href=
"../00index_e.html">Return
</a></p>