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.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
<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.
AndroidAndroid Widget This parameter can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its setup directory or one of its subdirectories, as well as to the external memory (SDCard).
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.
  • AndroidAndroid Widget In Android, a file stored on the external memory (SDCard) cannot be moved to the internal memory of the device (and conversely).

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