mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Add logic to VFS rename: If target of rename exists and is a directory, then the source file should be moved 'under' the target directory. POSIX also requires that if the target is a file, then that old file must be deleted.
This commit is contained in:
+4
-1
@@ -2419,7 +2419,10 @@ int fat_rename(FAR struct inode *mountpt, FAR const char *oldrelpath,
|
||||
{
|
||||
if (ret == OK)
|
||||
{
|
||||
/* It is an error if the object at newrelpath already exists */
|
||||
/* It is an error if the directory entry at newrelpath already
|
||||
* exists. The necessary steps to avoid this case should have
|
||||
* been handled by higher level logic in the VFS.
|
||||
*/
|
||||
|
||||
ret = -EEXIST;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user