- Moving the file
- Renaming a directory
- Renaming an HFSQL data file
- Handling errors
- Operating mode in Windows Vista (and later)
fRename (Function) In french: fRenomme Modifies the name of a file.
Syntax
<Result> = fRename(<Path of file to rename> , <New file path>)
<Result>: Boolean - True if the modification was performed,
- False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Path of file to rename>: Character string - Full path of the file to rename (up to 260 characters). A UNC path can be used.
- Relative path in relation to the current directory (returned by fCurrentDir). Wildcard characters are not allowed.
<New file path>: Character string - Full path of the file with the new name (up to 260 characters). A UNC path can be used.
- Relative path in relation to the current directory (returned by fCurrentDir).
Wildcard characters are not allowed. The path of the file must exist.
Remarks Moving the file If <Path of file to rename> and <New file path> contain the same file name but different access paths, fRename moves the file. Renaming a directory fRename can also be used to rename a directory. To rename a directory, the directory to rename must be different from the current directory of the application. Renaming an HFSQL data file Handling errors fRename throws an error in the following cases: - the file to rename does not exist,
- the file to rename is locked,
- the path of the file to rename is invalid,
- <New file path> or <Path of file to rename> is an empty string,
- the new file already exists.
Remark: This function operates on an empty file.
This page is also available for…
|
|
|
|