Intel® Fortran Compiler 16.0 User and Reference Guide

RENAMEFILEQQ

Portability Function: Renames a file.

Module

USE IFPORT

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:

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

See Also