rename

rename a file

Synopsis:

#include <stdio.h>
int rename( const char *old, const char *new );

Description:

The rename() function causes the file whose name is indicated by the string old to be renamed to the name given by the string new.

Returns:

The rename() function returns zero if the operation succeeds, a non-zero value if it fails. When an error has occurred, errno contains a value that indicates the type of error that has been detected.

See also:

errno

Examples:

#include <stdio.h>

void main()
  {
    rename( "old.dat", "new.dat" );
  }

Classification:

ANSI

Systems:

All (except Netware, DOS/PM)