rename

Renames a file

int rename (
        char *src,
        char *dest
)

Arguments

src Source filename
dest New filename

Return Value

1 is returned if the rename was successful.
0 is returned in all other cases.

Explanation

The filename specified by src is renamed to the name specified by dest.
The full path from the device name must be specified for both src and dest.

Notes

rename() is valid only for writeable file systems.