|
|
|
|
|
- Error handling
- Creating directories during the copy
Copies one or more files (regardless of their attributes). Sintaxis
Copying a file or a directory Ocultar los detalles
<Result> = fCopyFile(<Source file> , <Destination file or directory> [, <Copy indicator>])
<Result>: Boolean - True if the files have been copied,
- False otherwise. To get more details on 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 searched 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:  This parameter can be in Ansi or Unicode format.
Wildcard characters management (*,?): By default, wildcard characters are allowed in the file name.. Special case according to the platform: 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:  This parameter can be in Ansi or Unicode format.
<Copy indicator>: Optional constant Type of copy: | | frConfirm | Copy a file and ask for confirmation before overwriting a file with the same name. | frProgress | A progress window is displayed. If the file is small (a few bytes), the progress bar is not displayed. | frRecursive | Recursive 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. Observaciones Error handling 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.
Creating directories during the copy - If one of the directories of the destination path does not exist, it is automatically created.
 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). Note: To make directory copies, you can also use the fCopyDir function. Clasificación Lógica de negocio / UI: Lógica de negocio
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|