]> cloudbase.mooo.com Git - z180-stamp.git/blame - fatfs/documents/doc/chdir.html
Import fatfs R0.13b
[z180-stamp.git] / fatfs / documents / doc / chdir.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/chdir.html">\r
8<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">\r
9<title>FatFs - f_chdir</title>\r
10</head>\r
11\r
12<body>\r
13\r
14<div class="para func">\r
15<h2>f_chdir</h2>\r
289f6a14 16<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive.</p>\r
53668523
L
17<pre>\r
18FRESULT f_chdir (\r
19 const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Path name */</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>path</dt>\r
70702af1 28<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory</a> to go.</dd>\r
53668523
L
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#np">FR_NO_PATH</a>,\r
41<a href="rc.html#in">FR_INVALID_NAME</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<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>\r
47</p>\r
48</div>\r
49\r
50\r
51<div class="para desc">\r
52<h4>Description</h4>\r
289f6a14
L
53<p>The <tt>f_chdir</tt> function changes the current directory of the logical drive. Also the current drive is changed at Unix style volume ID, <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a> == 2</tt>. The current directory of each logical drive is initialized to the root directory on mount.</p>\r
54<p>Note that the current directory is retained in the each file system object and the current drive is retained in a static variable, so that it also affects other tasks that use the file functions.</p>\r
53668523
L
55</div>\r
56\r
57\r
58<div class="para comp">\r
59<h4>QuickInfo</h4>\r
289f6a14 60<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> &gt;= 1</tt>.</p>\r
53668523
L
61</div>\r
62\r
63\r
64<div class="para use">\r
65<h4>Example</h4>\r
66<pre>\r
289f6a14
L
67 <span class="c">/* Change current direcoty of the current drive ("dir1" under root directory) */</span>\r
68 <em>f_chdir</em>("/dir1");\r
53668523 69\r
289f6a14
L
70 <span class="c">/* Change current direcoty of current drive (parent directory of drive 2) */</span>\r
71 <em>f_chdir</em>("2:..");\r
72\r
73 <span class="c">/* Change current direcoty of the drive "sdcard" (at DOS/Windows style volume ID) */</span>\r
74 <em>f_chdir</em>("sdcard:/dir1");\r
75\r
76 <span class="c">/* Change current direcoty of the drive "flash" and set it as current drive (at Unix style volume ID) */</span>\r
77 <em>f_chdir</em>("/flash/dir1");\r
53668523
L
78</pre>\r
79</div>\r
80\r
81<div class="para ref">\r
82<h4>See Also</h4>\r
83<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="getcwd.html">f_getcwd</a></tt></p>\r
84</div>\r
85\r
86<p class="foot"><a href="../00index_e.html">Return</a></p>\r
87</body>\r
88</html>\r