Renamefile is used to delete a "physical" file given as an argument.

Syntax

  renamefile ( path_fic1, path_fic2 )

Parameters

Element

Description

Restrictions

path_fic1

Expression of Char type corresponding to the path of the file to rename

None

path_fic2

Expression of Char type corresponding to the path of the renamed file

None

Examples

# Renaming of file fic1 into fic2
Local Integer I
I = renamefile("/home/FIC1", "/home/FIC2")

Description

The function renamefile is used to rename a file.

Renamefile returns an integer that gives the result of the operation. If the result is different from 0, the renaming operation has failed.

Notes

The type of returned result is Integer.

On Windows, the file can be written with "/" or "\" indifferently.

If the file does not exist or is not accessible, the function renamefile returns the corresponding error number (with a negative sign), without generating any error in the processing. In principle, the errors returned will be in the following list:

Error

Description

PAFIC (20)

The file is non-existent

ERACCE (27)

access error (i.e. the directory is not accessible in principle

Associated keywords

DELFILE