ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Moving or renaming a file
  • Handling errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Moves a file from one directory to another. The file can be renamed during the move.
Example
// Move a file
Res is boolean = fMoveFile("D:\Example\Win1.wdw", "C:\Temp\Window\Win1.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: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/22/2022

Send a report | Local help