<p>The f_chdir function changes the current directory of a drive.</p>
<pre>
FRESULT f_chdir (
const TCHAR* <spanclass="arg">path</span><spanclass="c">/* [IN] Path name */</span>
);
</pre>
</div>
<divclass="para arg">
<h4>Parameters</h4>
<dlclass="par">
<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies a <ahref="filename.html">directory</a> to go.</dd>
</dl>
</div>
<divclass="para ret">
<h4>Return Values</h4>
<p>
<ahref="rc.html#ok">FR_OK</a>,
<ahref="rc.html#de">FR_DISK_ERR</a>,
<ahref="rc.html#ie">FR_INT_ERR</a>,
<ahref="rc.html#nr">FR_NOT_READY</a>,
<ahref="rc.html#np">FR_NO_PATH</a>,
<ahref="rc.html#in">FR_INVALID_NAME</a>,
<ahref="rc.html#id">FR_INVALID_DRIVE</a>,
<ahref="rc.html#ne">FR_NOT_ENABLED</a>,
<ahref="rc.html#ns">FR_NO_FILESYSTEM</a>,
<ahref="rc.html#tm">FR_TIMEOUT</a>,
<ahref="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
</p>
</div>
<divclass="para desc">
<h4>Description</h4>
<p>The <tt>f_chdir()</tt> function changes the current directory of the logical drive. The current directory of a drive is initialized to the root directory when the drive is auto-mounted. Note that the current directory is retained in the each file system object so that it also affects other tasks that using the volume.</p>
</div>
<divclass="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_RPATH >= 1</tt>.</p>
</div>
<divclass="para use">
<h4>Example</h4>
<pre>
<spanclass="c">/* Change current direcoty of the current drive (dir1 under root dir) */</span>
f_chdir("/dir1");
<spanclass="c">/* Change current direcoty of drive 2 (parent dir) */</span>