Portability Function: Renames a file.
Module: USE DFPORT
Syntax
Results:
The result is of type INTEGER(4). The result is zero if successful; otherwise, an error code, such as:
It is possible to rename a file to itself without error.
The paths can use forward (/) or backward (\) slashes as path separators and can include drive letters.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also: RENAMEFILEQQ
Example
use dfport
integer(4) istatus
character*12 old_name, new_name
print *, "Enter file to rename: "
read *, old_name
print *, "Enter new name: "
read *, new_name
ISTATUS = RENAME (old_name, new_name)