Portability Function: Renames a file.
Module: USE IFPORT
Syntax
result = RENAMEFILEQQ (oldname, newname)
oldname
(Input) Character*(*). Current name of the file to be renamed.
newname
(Input) Character*(*). New name of the file to be renamed.
Results
The result type is LOGICAL(4). The result is .TRUE. if successful; otherwise, .FALSE..
You can use RENAMEFILEQQ to move a file from one directory to another on the same drive by giving a different path in the newname parameter.
If the function fails, call GETLASTERRORQQ to determine the reason. One of the following errors can be returned:
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also
FINDFILEQQ, RENAME, GETLASTERRORQQ
Example
USE IFPORT
USE IFCORE
INTEGER(4) len
CHARACTER(80) oldname, newname
LOGICAL(4) result
WRITE(*,'(A, \)') ' Enter old name: '
len = GETSTRQQ(oldname)
WRITE(*,'(A, \)') ' Enter new name: '
len = GETSTRQQ(newname)
result = RENAMEFILEQQ(oldname, newname)
END