Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

rename - Rename file

&pagelevel(4)&pagelevel

Definition

#include <stdio.h>

int rename(const char *name_old, const char *name_new);

rename gives the file with the name name_old the new name name_new.

Return val.

0

-1

if successful.

if the file could not be renamed. If for example

  • there is no file with the name name_old,

  • a file is already cataloged under the name name_new or

  • the file to be renamed has been opened by a program.

In addition, errno is set to EMACRO.

Record I/O

rename can also be used unchanged on files with record I/O.