[Previous]
[Contents]
[Next]

rename()

rename a file

Synopsis:

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

Description:

The rename() function renames the file indicated by old to the name given by new.

Returns:

Zero if the operation succeeds, a nonzero value if it fails. When an error has occurred, errno indicates the type of error detected.

Examples:

#include <stdio.h>

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

Classification:

ANSI

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno


[Previous]
[Contents]
[Next]