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/getcwd.html"> 8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default"> 9e6865dcdSopenharmony_ci<title>FatFs - f_getcwd</title> 10e6865dcdSopenharmony_ci</head> 11e6865dcdSopenharmony_ci 12e6865dcdSopenharmony_ci<body> 13e6865dcdSopenharmony_ci 14e6865dcdSopenharmony_ci<div class="para func"> 15e6865dcdSopenharmony_ci<h2>f_getcwd</h2> 16e6865dcdSopenharmony_ci<p>The f_getcwd function retrieves the current directory of the current drive.</p> 17e6865dcdSopenharmony_ci<pre> 18e6865dcdSopenharmony_ciFRESULT f_getcwd ( 19e6865dcdSopenharmony_ci TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Buffer to return path name */</span> 20e6865dcdSopenharmony_ci UINT <span class="arg">len</span> <span class="c">/* [IN] The length of the buffer */</span> 21e6865dcdSopenharmony_ci); 22e6865dcdSopenharmony_ci</pre> 23e6865dcdSopenharmony_ci</div> 24e6865dcdSopenharmony_ci 25e6865dcdSopenharmony_ci<div class="para arg"> 26e6865dcdSopenharmony_ci<h4>Parameters</h4> 27e6865dcdSopenharmony_ci<dl class="par"> 28e6865dcdSopenharmony_ci<dt>buff</dt> 29e6865dcdSopenharmony_ci<dd>Pointer to the buffer to receive the current directory string.</dd> 30e6865dcdSopenharmony_ci<dt>len</dt> 31e6865dcdSopenharmony_ci<dd>Size of the buffer in unit of <tt>TCHAR</tt>.</dd> 32e6865dcdSopenharmony_ci</dl> 33e6865dcdSopenharmony_ci</div> 34e6865dcdSopenharmony_ci 35e6865dcdSopenharmony_ci 36e6865dcdSopenharmony_ci<div class="para ret"> 37e6865dcdSopenharmony_ci<h4>Return Values</h4> 38e6865dcdSopenharmony_ci<p> 39e6865dcdSopenharmony_ci<a href="rc.html#ok">FR_OK</a>, 40e6865dcdSopenharmony_ci<a href="rc.html#de">FR_DISK_ERR</a>, 41e6865dcdSopenharmony_ci<a href="rc.html#ie">FR_INT_ERR</a>, 42e6865dcdSopenharmony_ci<a href="rc.html#nr">FR_NOT_READY</a>, 43e6865dcdSopenharmony_ci<a href="rc.html#ne">FR_NOT_ENABLED</a>, 44e6865dcdSopenharmony_ci<a href="rc.html#ns">FR_NO_FILESYSTEM</a>, 45e6865dcdSopenharmony_ci<a href="rc.html#tm">FR_TIMEOUT</a>, 46e6865dcdSopenharmony_ci<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a> 47e6865dcdSopenharmony_ci</p> 48e6865dcdSopenharmony_ci</div> 49e6865dcdSopenharmony_ci 50e6865dcdSopenharmony_ci 51e6865dcdSopenharmony_ci<div class="para desc"> 52e6865dcdSopenharmony_ci<h4>Description</h4> 53e6865dcdSopenharmony_ci<p>The <tt>f_getcwd</tt> function retrieves full path name of the current directory of the current drive. When <tt><a href="config.html#volumes">FF_VOLUMES</a> >= 2</tt>, a heading drive prefix is added to the path name. The style of drive prefix depends on <tt><a href="config.html#str_volume_id">FF_STR_VOLUME_ID</a></tt>.</p> 54e6865dcdSopenharmony_ci<p><em>Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.</em></p> 55e6865dcdSopenharmony_ci</div> 56e6865dcdSopenharmony_ci 57e6865dcdSopenharmony_ci 58e6865dcdSopenharmony_ci<div class="para comp"> 59e6865dcdSopenharmony_ci<h4>QuickInfo</h4> 60e6865dcdSopenharmony_ci<p>Available when <tt><a href="config.html#fs_rpath">FF_FS_RPATH</a> == 2</tt>.</p> 61e6865dcdSopenharmony_ci</div> 62e6865dcdSopenharmony_ci 63e6865dcdSopenharmony_ci 64e6865dcdSopenharmony_ci<div class="para use"> 65e6865dcdSopenharmony_ci<h4>Example</h4> 66e6865dcdSopenharmony_ci<pre> 67e6865dcdSopenharmony_ci FRESULT fr; 68e6865dcdSopenharmony_ci TCHAR str[SZ_STR]; 69e6865dcdSopenharmony_ci 70e6865dcdSopenharmony_ci fr = <em>f_getcwd</em>(str, SZ_STR); <span class="c">/* Get current directory path */</span> 71e6865dcdSopenharmony_ci 72e6865dcdSopenharmony_ci</pre> 73e6865dcdSopenharmony_ci</div> 74e6865dcdSopenharmony_ci 75e6865dcdSopenharmony_ci 76e6865dcdSopenharmony_ci<div class="para ref"> 77e6865dcdSopenharmony_ci<h4>See Also</h4> 78e6865dcdSopenharmony_ci<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="chdir.html">f_chdir</a></tt></p> 79e6865dcdSopenharmony_ci</div> 80e6865dcdSopenharmony_ci 81e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p> 82e6865dcdSopenharmony_ci</body> 83e6865dcdSopenharmony_ci</html> 84