X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/e1deb7c3bc0500aabf5d099adb231f6d1d27f01d..b30c4e8f1aef96f6fdc93da9f125545f5f74d06e:/fatfs/doc/en/rename.html 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 @@

f_rename

-

Renames a file or sub-directory.

+

The f_rename function renames and/or moves a file or sub-directory.

 FRESULT f_rename (
   const TCHAR* old_name, /* [IN] Old object name */
@@ -26,9 +26,9 @@ FRESULT f_rename (
 

Parameters

old_name
-
Pointer to a null-terminated string that specifies an existing file or sub-directory to be renamed.
+
Pointer to a null-terminated string that specifies the existing file or sub-directory to be renamed.
new_name
-
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 old_name is used instead.
+
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 old_name. Any object with this path name except old_name must not be exist, or the function fails with FR_EXIST.
@@ -58,7 +58,7 @@ FRESULT f_rename (

Description

-

Renames a file or sub-directory and can also move it to other directory within the same logical drive. Do not rename open objects or directry table can be broken.

+

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 the FAT volume can be collapsed. Such the wrong operation is rejected safely when file lock function is enabled.

@@ -71,11 +71,14 @@ FRESULT f_rename (

Example

-    /* Rename an object */
+    /* Rename an object in the default drive */
     f_rename("oldname.txt", "newname.txt");
 
-    /* Rename and move an object to other directory */
-    f_rename("oldname.txt", "dir1/newname.txt");
+    /* Rename an object in the drive 2 */
+    f_rename("2:oldname.txt", "newname.txt");
+
+    /* Rename an object and move it to other directory in the volume */
+    f_rename("log.txt", "old/log0001.txt");