Renames the specified file.
#include <stdio.h> int rename ( const char *old, const char *new);
(IN) Points to a string containing the pathname of the file to be renamed.
(IN) Points to a string containing the new pathname of the file.
If successful, returns 0; otherwise returns -1 and sets errno to one of the following:
The rename function takes on either NetWare/DOS semantics or POSIX semantics.
POSIX: If an NLM is compiled with POSIX prelude file (posixpre) or the POSIX semantics flag, the rename function allows you to rename FileA to FileB even if FileB already exists. FileB is deleted, and then the rename occurs. The rename function cannot be used to rename a directory to an existing filename or rename a file to an existing directory name.
NetWare: If the NLM is not compiled to use POSIX prelude file, the rename function uses NetWare semantics. The function fails when you try to rename a file to the name of an existing file. If you rename FileA to DirectoryB, FileA moves under DirectoryB. Renaming DirectoryA to FileB fails.
With NetWare semantics, wildcard specifiers are allowed for the old and new parameters. However, if a wildcard is specified, only matching files (not directories) are renamed.