summaryrefslogtreecommitdiff
path: root/fatfs/doc/en/rename.html
diff options
context:
space:
mode:
authorLeo C2016-09-08 19:15:27 +0200
committerLeo C2016-09-08 19:15:27 +0200
commit70702af1370e44e32fb2c3c507e4759a187b4fe5 (patch)
tree5b75a408efadf5fccd8d5d481e91cce73a86897b /fatfs/doc/en/rename.html
parent7b78a5a287827db9e9b16286f3604aef69b37c5c (diff)
downloadz180-stamp-fatfs-0.12b.zip
Import fatfs R0.12bfatfs-0.12b
Diffstat (limited to 'fatfs/doc/en/rename.html')
-rw-r--r--fatfs/doc/en/rename.html17
1 files changed, 10 insertions, 7 deletions
diff --git a/fatfs/doc/en/rename.html b/fatfs/doc/en/rename.html
index 2593e89..10cb4fd 100644
--- a/fatfs/doc/en/rename.html
+++ b/fatfs/doc/en/rename.html
@@ -13,7 +13,7 @@
<div class="para func">
<h2>f_rename</h2>
-<p>Renames a file or sub-directory.</p>
+<p>The f_rename function renames and/or moves a file or sub-directory.</p>
<pre>
FRESULT f_rename (
const TCHAR* <span class="arg">old_name</span>, <span class="c">/* [IN] Old object name */</span>
@@ -26,9 +26,9 @@ FRESULT f_rename (
<h4>Parameters</h4>
<dl class="par">
<dt>old_name</dt>
-<dd>Pointer to a null-terminated string that specifies an existing <a href="filename.html">file or sub-directory</a> to be renamed.</dd>
+<dd>Pointer to a null-terminated string that specifies the existing <a href="filename.html">file or sub-directory</a> to be renamed.</dd>
<dt>new_name</dt>
-<dd>Pointer to a null-terminated string that specifies the new object name. The drive number specified in this string is ignored and one determined by <tt class="arg">old_name</tt> is used instead.</dd>
+<dd>Pointer to a null-terminated string that specifies the new object name. A drive number may be specified in this string but it is ignored and assumed as the same drive of the <tt class="arg">old_name</tt>. Any object with this path name except <tt class="arg">old_name</tt> must not be exist, or the function fails with <tt>FR_EXIST</tt>.</dd>
</dl>
</div>
@@ -58,7 +58,7 @@ FRESULT f_rename (
<div class="para desc">
<h4>Description</h4>
-<p>Renames a file or sub-directory and can also move it to other directory within the same logical drive. <em>Do not rename open objects</em> or directry table can be broken.</p>
+<p>Renames a file or sub-directory and can also move it to other directory in the same volume. The object to be renamed must not be an open object, or <em>the FAT volume can be collapsed</em>. Such the wrong operation is rejected safely when <a href="appnote.html#dup">file lock function</a> is enabled.</p>
</div>
@@ -71,11 +71,14 @@ FRESULT f_rename (
<div class="para use">
<h4>Example</h4>
<pre>
- <span class="c">/* Rename an object */</span>
+ <span class="c">/* Rename an object in the default drive */</span>
f_rename("oldname.txt", "newname.txt");
- <span class="c">/* Rename and move an object to other directory */</span>
- f_rename("oldname.txt", "dir1/newname.txt");
+ <span class="c">/* Rename an object in the drive 2 */</span>
+ f_rename("2:oldname.txt", "newname.txt");
+
+ <span class="c">/* Rename an object and move it to other directory in the volume */</span>
+ f_rename("log.txt", "old/log0001.txt");
</pre>
</div>