rename a file
#include <stdio.h> int rename( const char *old, const char *new );
The rename() function renames the file indicated by old to the name given by new.
Zero if the operation succeeds, a nonzero value if it fails. When an error has occurred, errno indicates the type of error detected.
#include <stdio.h>
void main()
{
rename( "old.dat", "new.dat" );
}
ANSI
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |