Comments (3)
ping
from rt-thread.
@prife please provide your comments.
from rt-thread.
sorry for responding so late.
int dfs_file_rename(const char *oldpath, const char *newpath)
{
int result;
struct dfs_filesystem *oldfs, *newfs;
char *oldfullpath, *newfullpath;
result = DFS_STATUS_OK;
newfullpath = RT_NULL;
oldfullpath = RT_NULL;
oldfullpath = dfs_normalize_path(RT_NULL, oldpath);
if (oldfullpath == RT_NULL)
{
result = -DFS_STATUS_ENOENT;
goto __exit;
}
newfullpath = dfs_normalize_path(RT_NULL, newpath);
if (newfullpath == RT_NULL)
{
result = -DFS_STATUS_ENOENT;
goto __exit;
}
oldfs = dfs_filesystem_lookup(oldfullpath);
newfs = dfs_filesystem_lookup(newfullpath);
if (oldfs == newfs)
{
if (oldfs->ops->rename == RT_NULL)
{
result = -DFS_STATUS_ENOSYS;
}
else
{
if (oldfs->ops->flags & DFS_FS_FLAG_FULLPATH)
result = oldfs->ops->rename(oldfs, oldfullpath, newfullpath);
else
/* use sub directory to rename in file system */
result = oldfs->ops->rename(oldfs,
dfs_subdir(oldfs->path, oldfullpath),
dfs_subdir(newfs->path, newfullpath));
}
}
else
{
result = -DFS_STATUS_EXDEV;
}
__exit:
rt_free(oldfullpath);
rt_free(newfullpath);
/* not at same file system, return EXDEV */
return result;
}
what rename in RTT return seems depends the rename implemented on the specific fs.
from rt-thread.
Related Issues (20)
- 异步I/O的aio_write函数
- [bsp] loongson 下 ls2kdev 链接时报错 undefined reference to `sbrk' HOT 1
- v5.1.1 需要推进的点 HOT 6
- 5.0.2版本stm32f103-100ask-pro的spi_flash_init.c缺少#include "drv_gpio.h" HOT 2
- [drv_eth] STM32以太网BSP驱动的PHY物理地址问题 HOT 1
- rt_can_read memory write out of boundary HOT 1
- RTThread不支持 STM32CUBEMX 生成的Advanced工程,只支持Basic工程。
- RT-thread 移植到RISC-V裸片的问题 HOT 1
- shell.c 文件中finsh_get_prompt()函数使用strcat()函数会造成数据访问异常 HOT 1
- [msh] 自动补全子选项 没有使用说明与注释
- [finsh] finsh_syscall_lookup是否应该删除
- 使用DUO开发板,编译RT-Thread大核时编译不过 HOT 2
- [ipc]负值不明确的转换导致编译警告
- [mem]MIN_SIZE宏定义 不易于理解 HOT 1
- 关于LWP的修改带来的问题 HOT 6
- 使用RT-Studio生产的STM32F407VE工程运行一段时间后自动停止, update -> 发现是串口无法持续输出 HOT 11
- 目前不使用设备树的aarch64 BSP不能使用PSCI方案管理CPU,能否针对这种情况做一下兼容呢? HOT 5
- rt-thread/bsp/qemu-vexpress-a9下编译失败 HOT 1
- bsp/renesas/rzt2m_rsk bsp目录是否可以优化一下? HOT 5
- 关于野火霸道开发版的bsp包,本地编译后显示Undefined symbol rt_condvar_init (referred from pipe.o)问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rt-thread.