ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Moving or renaming a file
  • Handling errors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Moves a file from one directory to another. The file can be renamed during the move.
Example
// Déplacement d'un fichier
Res is boolean = fMoveFile("D:\Exemple\Fen1.wdw", "C:\Temp\Fenêtre\Fen1.wdw")
Syntax
<Result> = fMoveFile(<Path of source file> , <New file path>)
<Result>: Boolean
  • True if the move was performed,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Path of source file>: Character string
Name and full (or relative) path of the file to move (up to 260 characters). A UNC path can be used. Wildcard characters are not allowed.
WindowsLinux This parameter can be in Ansi or Unicode format.
<New file path>: Character string
New name and full (or relative) path of the file (up to 260 characters). A UNC path can be used. Wildcard characters are not allowed.
WindowsLinux This parameter can be in Ansi or Unicode format.
Remarks

Moving or renaming a file

If <Path of source file> and <New file path> contain the same file name but different access paths, fMoveFile moves the file.
If <Path of source file> and <New file path> contain different file names and different paths, fMoveFile moves and renames the file.
Remarks:
  • In Windows, fMoveFile is equivalent to fRename.

Handling errors

fMoveFile throws an error in the following cases:
  • the file to move does not exist,
  • the file to move is locked,
  • the path of the file to move is invalid,
  • <New file path> or <Path of source file> is an empty string,
  • the new file already exists.
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help