PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Copies the contents of a directory and its subdirectories.
// Copy a directory
Res = fCopyDir("C:\Directory\MyFiles", "D:\Documents\FileCopy", ...
frConfirm + frProgress + frRecursive)
Versions 19 and later
// Copy a directory
Res = fCopyDir("C:\Directory\MyFiles", "D:\Documents\FileCopy", FilterFile)
PROCÉDURE FilterFile(sSourcePath, sDestinationPath, flChange, nCustomParameter)

// Don't copy the temporary files
IF fExtractPath(sSourcePath, fExtension) ~= ".tmp"
RESULT fcIgnore
ELSE
RESULT fcCopy
END
New in version 19
// Copy a directory
Res = fCopyDir("C:\Directory\MyFiles", "D:\Documents\FileCopy", FilterFile)
PROCÉDURE FilterFile(sSourcePath, sDestinationPath, flChange, nCustomParameter)

// Don't copy the temporary files
IF fExtractPath(sSourcePath, fExtension) ~= ".tmp"
RESULT fcIgnore
ELSE
RESULT fcCopy
END
// Copy a directory
Res = fCopyDir("C:\Directory\MyFiles", "D:\Documents\FileCopy", FilterFile)
PROCÉDURE FilterFile(sSourcePath, sDestinationPath, flChange, nCustomParameter)

// Don't copy the temporary files
IF fExtractPath(sSourcePath, fExtension) ~= ".tmp"
RESULT fcIgnore
ELSE
RESULT fcCopy
END
Syntax

Copying a directory Hide the details

<Result> = fCopyDir(<Path of directory to copy> , <Path of destination directory> [, <Copy indicator>])
<Result>: Boolean
  • True if the copy was performed,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
Java False if a single file is not copied.
<Path of directory to copy>: Character string (with quotes)
Name and full (or relative) path of directory to copy (up to 260 characters). A UNC path can be used. Wildcard characters (*,?) are allowed in the file name. This directory name may (or may not) end with "\".
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
Java Wildcard characters (*,?) are not allowed in the file name.
<Path of destination directory>: Character string (with quotes)
Name and full (or relative) path of copied directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
This directory is automatically created if it does not exist.
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
<Copy indicator>: Optional constant (or combination of constants)
Type of copy to perform:
frConfirmCopy a directory and ask for confirmation before overwriting a directory with the same name.
frProgressA progress window is displayed.
Java This constant is not available.
frRecursiveSubdirectories are processed.

<Copy indicator> is empty by default. None of these options is selected.
Versions 19 and later
WINDEVUser code (UMC)

Copying a directory by handling each copied file Hide the details

<Result> = fCopyDir(<Path of directory to copy> , <Path of destination directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the copy was performed,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Path of directory to copy>: Character string (with quotes)
Name and full (or relative) path of directory to copy (up to 260 characters). A UNC path can be used. Wildcard characters (*,?) are allowed in the file name. This directory name may (or may not) end with "\".
WindowsLinux This parameter can be in Ansi or Unicode format.
<Path of destination directory>: Character string (with quotes)
Name and full (or relative) path of copied directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
This directory is automatically created if it does not exist.
WindowsLinux This parameter can be in Ansi or Unicode format.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called for each copied file. This procedure is used to handle the current file.
For more details on this procedure, see Parameters of the procedure used by fCopyDir.
<Pointer>: Optional integer
Pointer passed to <WLanguage procedure>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveSubdirectories are processed.

<Copy indicator> is empty by default: the process is not recursive.
New in version 19
WINDEVUser code (UMC)

Copying a directory by handling each copied file Hide the details

<Result> = fCopyDir(<Path of directory to copy> , <Path of destination directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the copy was performed,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Path of directory to copy>: Character string (with quotes)
Name and full (or relative) path of directory to copy (up to 260 characters). A UNC path can be used. Wildcard characters (*,?) are allowed in the file name. This directory name may (or may not) end with "\".
WindowsLinux This parameter can be in Ansi or Unicode format.
<Path of destination directory>: Character string (with quotes)
Name and full (or relative) path of copied directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
This directory is automatically created if it does not exist.
WindowsLinux This parameter can be in Ansi or Unicode format.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called for each copied file. This procedure is used to handle the current file.
For more details on this procedure, see Parameters of the procedure used by fCopyDir.
<Pointer>: Optional integer
Pointer passed to <WLanguage procedure>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveSubdirectories are processed.

<Copy indicator> is empty by default: the process is not recursive.
WINDEVUser code (UMC)

Copying a directory by handling each copied file Hide the details

<Result> = fCopyDir(<Path of directory to copy> , <Path of destination directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the copy was performed,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Path of directory to copy>: Character string (with quotes)
Name and full (or relative) path of directory to copy (up to 260 characters). A UNC path can be used. Wildcard characters (*,?) are allowed in the file name. This directory name may (or may not) end with "\".
WindowsLinux This parameter can be in Ansi or Unicode format.
<Path of destination directory>: Character string (with quotes)
Name and full (or relative) path of copied directory (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with "\".
This directory is automatically created if it does not exist.
WindowsLinux This parameter can be in Ansi or Unicode format.
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called for each copied file. This procedure is used to handle the current file.
For more details on this procedure, see Parameters of the procedure used by fCopyDir.
<Pointer>: Optional integer
Pointer passed to <WLanguage procedure>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveSubdirectories are processed.

<Copy indicator> is empty by default: the process is not recursive.
Remarks
WINDEVUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
Indeed, in Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have the administrator privileges to handle and/or modify the files or directories in the system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
  • avoid writing into the Windows directory or into the "Program Files" directory,
  • use the system directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant).
Remark: In Windows Vista (and later), the virtualization mechanism is used to make the applications compatible with Vista. If the file is created in a system directory without having sufficient rights, this file will actually be created in another directory (C:\Users\<LOGIN>AppData\Local\VirtualStore\Windows\). In this case, the file cannot be shared between several applications.
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment