SPNU151W January 1998 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
Rename File
#include {<stdio.h> | <file.h>}
int rename (const char *old_name , const char *new_name );
#include {<cstdio> | <file.h>}
int std::rename (const char *old_name , const char *new_name );
The rename function changes the name of a file.
The optional device specified in the new name must match the device of the old name. If they do not match, a file copy would be required to perform the rename, and rename is not capable of this action.
The function returns one of the following values:
0 | if successful |
-1 | on failure |
Although rename is a low-level function, it is defined by the C standard and can be used by portable applications.