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
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Copies the contents of a directory and its subdirectories.
// Copie d'un répertoire
Res = fCopyDir("C:\Répertoire\MesFichiers", "D:\Documents\CopieFichier", ...
		frConfirm + frProgress + frRecursive)
// Copie d'un répertoire
Res = fCopyDir("C:\Répertoire\MesFichiers", "D:\Documents\CopieFichier", FiltreFichier)
PROCEDURE FiltreFichier(sCheminSource, sCheminDestination, flChange, nParamètrePerso)

// On ne copie pas les fichiers temporaires
IF fExtractPath(sCheminSource, fExtension) ~= ".tmp"
	RETURN fcIgnore
ELSE
	RETURN 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 image was copied,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
Java False if a single file is not copied.
<Path of directory to copy>: Character string
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.
Java Wildcard characters (*,?) are not allowed in the file name.
<Path of destination directory>: Character string
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.
<Copy indicator>: Optional constant (or combination of constants)
Type of copy:
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.

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 image was copied,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Path of directory to copy>: Character string
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 "\".
Java Wildcard characters (*,?) are not allowed in the file name.
WindowsLinux This parameter can be in Ansi or Unicode format.
<Path of destination directory>: Character string
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 the WLanguage procedure ("callback") called for each file copied. 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:
frRecursiveSubdirectories are processed.

By default, <Indicateur de copie> is empty: processing is not recursive.
Remarks
WINDEVUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not work 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).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: If you need to manipulate / modify files or directories, without needing administrator privileges, it is advisable:
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
Remark: Under Windows Vista (and higher), the virtualization mechanism makes applications Vista-compatible.. 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.
Business / UI classification: Business Logic
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