MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rename

Function rename

components/dfs/dfs_v1/src/dfs_posix.c:349–362  ·  view source on GitHub ↗

* this function is a POSIX compliant version, which will rename old file name * to new file name. * * @param old_file the old file name. * @param new_file the new file name. * * @return 0 on successful, -1 on failed. * * note: the old and new file name must be belong to a same file system. */

Source from the content-addressed store, hash-verified

347 * note: the old and new file name must be belong to a same file system.
348 */
349int rename(const char *old_file, const char *new_file)
350{
351 int result;
352
353 result = dfs_file_rename(old_file, new_file);
354 if (result < 0)
355 {
356 rt_set_errno(result);
357
358 return -1;
359 }
360
361 return 0;
362}
363RTM_EXPORT(rename);
364#endif
365

Callers 4

cmd_mvFunction · 0.50
sys_renameFunction · 0.50
_rename_rFunction · 0.50
test_posix_renameFunction · 0.50

Calls 2

rt_set_errnoFunction · 0.85
dfs_file_renameFunction · 0.70

Tested by 1

test_posix_renameFunction · 0.40