PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Managing errors
  • Operating mode in Windows Vista (and later)
  • Creating directories during the copy
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
Copies one or more files (regardless of their attributes).
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android widget mode.
New in version 18
Android Widget This function is now available in Android widget mode.
Android Widget This function is now available in Android widget mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 27 and later
AndroidAndroid Widget Java Syntax 2 (Copy one or more files by manipulating each copied file) is now available.
New in version 27
AndroidAndroid Widget Java Syntax 2 (Copy one or more files by manipulating each copied file) is now available.
AndroidAndroid Widget Java Syntax 2 (Copy one or more files by manipulating each copied file) is now available.
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjax
// Copie de "Fichier.doc" vers "CopieFichier.doc"
Res = fCopyFile("C:\Répertoires\Fichier.doc", "D:\Documents\CopieFichier.doc")
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)PHPAjax
// Copie les fichiers présents dans le répertoire "C:\MesImages"
// Les sous-répertoires et leurs fichiers sont pris en compte (constante frRécursif)
ResCopie = fCopyFile("C:\MesImages\*.*", "D:\MesFichiers\", frRecursive)
Syntax

Copying a a file or a directory Hide the details

<Result> = fCopyFile(<Source file> , <Destination file or directory> [, <Copy indicator>])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Source file>: Character string
File to copy (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
Special cases according to the platforms:
  • 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.
  • Versions 15 and later
    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 in version 15
    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).
    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).
  • Versions 17 and later
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    New in version 17
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
Management of wildcard characters (*,?): By default, the wildcard characters are allowed in the name of the file.
Special case according to the platform:
  • Versions 18 and later
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    New in version 18
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
  • Java If the "*.*" expression is used, only the files that have an extension will be copied.
  • PHP Wildcard characters (*,?) are allowed in the file path and in the file name.
<Destination file or directory>: Character string
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically created in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
  • a full or relative path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Special cases according to the platforms:
  • 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.
  • Versions 15 and later
    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 in version 15
    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).
    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).
  • Versions 17 and later
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    New in version 17
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
<Copy indicator>: Optional constant
Type of copy to perform:
frConfirmCopy a file and ask for confirmation before overwriting a file with the same name.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget PHP This constant is not available.
frProgressA progress window is displayed. If the file is small (a few bytes), the progress bar is not displayed.
WEBDEV - Server codeUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaPHP This constant is not available.
frRecursiveRecursive copy of the files. The subdirectories and their files are taken into account.

<Copy indicator> is empty by default. None of these options is selected.
Versions 19 and later
PHP Not available in PHP

Copying one or more files by handling each copied file Hide the details

<Result> = fCopyFile(<Source file> , <Destination file or directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Source file>: Character string
File to copy (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
Special cases according to the platforms:
  • 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.
  • Versions 27 and later
    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 in version 27
    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).
    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).
  • iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
Management of wildcard characters (*,?): By default, the wildcard characters are allowed in the name of the file.
Special case according to the platform:
  • Versions 18 and later
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    New in version 18
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
  • AndroidAndroid Widget Java If the "*.*" expression is used, only the files that have an extension will be copied.
<Destination file or directory>: Character string
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically created in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
  • a full or relative path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Special cases according to the platforms:
  • 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.
  • Versions 15 and later
    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 in version 15
    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).
    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).
  • Versions 17 and later
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    New in version 17
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") 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 fCopyFile.
<Pointer>: Optional integer
Pointer passed to <Procedure name>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveRecursive copy of the files. The subdirectories and their files are taken into account.

<Copy indicator> is empty by default: the process is not recursive.
New in version 19
PHP Not available in PHP

Copying one or more files by handling each copied file Hide the details

<Result> = fCopyFile(<Source file> , <Destination file or directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Source file>: Character string
File to copy (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
Special cases according to the platforms:
  • 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.
  • Versions 27 and later
    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 in version 27
    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).
    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).
  • iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
Management of wildcard characters (*,?): By default, the wildcard characters are allowed in the name of the file.
Special case according to the platform:
  • Versions 18 and later
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    New in version 18
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
  • AndroidAndroid Widget Java If the "*.*" expression is used, only the files that have an extension will be copied.
<Destination file or directory>: Character string
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically created in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
  • a full or relative path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Special cases according to the platforms:
  • 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.
  • Versions 15 and later
    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 in version 15
    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).
    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).
  • Versions 17 and later
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    New in version 17
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") 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 fCopyFile.
<Pointer>: Optional integer
Pointer passed to <Procedure name>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveRecursive copy of the files. The subdirectories and their files are taken into account.

<Copy indicator> is empty by default: the process is not recursive.
PHP Not available in PHP

Copying one or more files by handling each copied file Hide the details

<Result> = fCopyFile(<Source file> , <Destination file or directory> , <WLanguage procedure> [, <Pointer> [, <Copy indicator>]])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. To get the details of the error, use ErrorInfo with the errMessage constant.
<Source file>: Character string
File to copy (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
Special cases according to the platforms:
  • 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.
  • Versions 27 and later
    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 in version 27
    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).
    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).
  • iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
Management of wildcard characters (*,?): By default, the wildcard characters are allowed in the name of the file.
Special case according to the platform:
  • Versions 18 and later
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    New in version 18
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
    Universal Windows 10 App Wildcard characters (*,?) are not allowed in the file name.
  • AndroidAndroid Widget Java If the "*.*" expression is used, only the files that have an extension will be copied.
<Destination file or directory>: Character string
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • a file name. This file will be automatically created in the current directory (returned by fCurrentDir).
  • a file name with its full or relative path. A UNC path can be used.
  • a full or relative path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Special cases according to the platforms:
  • 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.
  • Versions 15 and later
    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 in version 15
    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).
    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).
  • Versions 17 and later
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    New in version 17
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
    iPhone/iPadIOS WidgetMac Catalyst 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: On iPhone/iPad, 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.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") 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 fCopyFile.
<Pointer>: Optional integer
Pointer passed to <Procedure name>.
<Copy indicator>: Optional constant
Type of copy to perform:
frRecursiveRecursive copy of the files. The subdirectories and their files are taken into account.

<Copy indicator> is empty by default: the process is not recursive.
Remarks

Managing errors

fCopyFile throws an error in the following cases:
  • the file to copy does not exist,
  • the file to copy is locked,
  • is invalid,
  • <Path of copied file> is an empty string,
  • <Path of file to copy> and <Path of copied file> are identical.
WINDEVReports and QueriesUser 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).
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: To handle and/or modify the files or directories without administrator privileges, you should:
  • 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).

Creating directories during the copy

  • If one of the directories of the destination path does not exist, it is automatically created.
  • WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)Ajax If the source file corresponds to all the files found in a directory (for example, C:\Temp\*.*), the frRecursive constant must be used to create the subdirectories in the destination (and to copy their content).
Remark: To copy directories, you also have the ability to use fCopyDir.
Related Examples:
Handling text files Unit examples (WINDEV): Handling text files
[ + ] Handling "text" files with WINDEV:
- Create a text file
- Write into a text file
- Read in a text file
Handling text files Unit examples (WEBDEV): Handling text files
[ + ] This example explains how to handle "non HFSQL" files with WEBDEV and it allows you to:
- Create a text file
- Write into a text file
- Read in a text file
Handling text files Unit examples (WINDEV Mobile): Handling text files
[ + ] Handling external "text" files:
- Create a text file
- Write into a text file
- Read in a text file
Business / UI classification: Business Logic
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment