Purpose
 

RENAME_FILE renames a file.

Syntax
 

RENAME_FILE(<filepath>, <newfilename>)

Operation

<filepath> Full path to the file

<newfilename> Name of the file after the rename.

Remarks

Returns:

1 - File renamed

-1 - File cannot be renamed

Read and Write access to the file is required in order to rename it. Only files, not directories, can be renamed. Files created without a full path will not be renamed.

Example

#RC = RENAME_FILE("c:\temp\example.txt", "renamed_example.txt")

Error codes are returned to the caller.

Comment on this topic

Topic ID: 520199