ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Copying a directory and its subdirectories
  • Copying the directory selected by the user
fCopyDir (Example)
Copying a directory and its subdirectories
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax The following code is used to copy a directory. Subdirectories are also copied (frRecursive constant).
// Declare the variables
DirectoryToCopy is string
CopiedDirectory is string
ResCopy is boolean
// Select the directory to copy
DirectoryToCopy = "C:\DirectoryA"
// Select the copied directory
CopiedDirectory = "C:\DirectoryB"
// Copy the directory
ResCopy = fCopyDir(DirectoryToCopy, CopiedDirectory, frRecursive)
// Display an error message if the copy failed
IF ResCopy = False THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The directories have been copied")
END
Copying the directory selected by the user
WINDEVReports and QueriesUser code (UMC) The following code is used to copy a directory. The directory to be copied and the copied directory are selected with fSelectDir. A progress window is displayed (frProgress constant).
// Declare the variables
DirectoryToCopy is string
CopiedDirectory is string
ResCopy is boolean
// Select the directory to copy
DirectoryToCopy = fSelectDir("", "Select the directory to copy")
// Select the copied directory
CopiedDirectory = fSelectDir("", "Select the copied directory")
// Copy the directory
ResCopy = fCopyDir(DirectoryToCopy, CopiedDirectory, frProgress)
// Display an error message if the copy failed
IF ResCopy = False THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The directory was copied")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/22/2022

Send a report | Local help