- Managing errors
- Operating mode in Windows Vista (and later)
- Creating directories during the copy
- Equivalence
fCopyFile (Function) In french: fCopieFichier 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 (with quotes) 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 This parameter can be in Ansi or Unicode format. New in version 15 This parameter can be in Ansi or Unicode format.  This parameter can be in Ansi or Unicode format. Versions 15 and later 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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard). New in version 15 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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard).  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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard). Versions 17 and later 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 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. 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 Wildcard characters (*,?) are not allowed in the file name. New in version 18 Wildcard characters (*,?) are not allowed in the file name. Wildcard characters (*,?) are not allowed in the file name. If the "*.*" expression is used, only the files that have an extension will be copied. Wildcard characters (*,?) are allowed in the file path and in the file name. Wildcard characters (*,?) are not allowed.
<Destination file or directory>: Character string (with quotes) 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 This parameter can be in Ansi or Unicode format. New in version 15 This parameter can be in Ansi or Unicode format.  This parameter can be in Ansi or Unicode format. Versions 15 and later 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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard). New in version 15 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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard).  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 has the rights to write into its setup directory or into one of its subdirectories, as well as onto the external memory (SDCard). This parameter can correspond to: - a file name with its path.
- a path, only for a copy with wildcard characters. If this parameter corresponds to a directory name, this name may (or may not) end with "\".
Versions 17 and later 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 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. 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: | | 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. Versions 19 and later New in version 19Remarks Managing errors fCopyFile generates 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.
Related Examples:
|
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
|
|
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
|
|
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
|
This page is also available for…
|
|
|
| |
| | https://youtu.be/qws0RUJ0Eqs
http://windevdesenvolvimento.blogspot.com.br/2018/05/dicas-1745-privada-windev-arquivos-29.html
https://groups.google.com/d/forum/amarildowindev
// EXEMPLO
// COPIAR ARQUIVO
// http://doc.windev.com/en-US/?3036004&name=fcopyfile_function
Resultado is boolean = fCopyFile("C:\amarildo\ipi.txt", EDT_DIRETORIO+"ipi.txt")
|
|
|
|
| |
| |
| |
|
| | Copiar Arquivo
Nessa aula vou mostrar como copiar um arquivo This lesson will show you how to copy a file Cette leçon va vous montrer comment copier un fichier
n_resultado is int=fCopyFile("D:\amarildo\Copia\copiaarquivo.txt","D:\amarildo\Copia\novoarquivo.txt")
n_resultado_F est entier=fCopieFichier("D:\amarildo\Copia\copiaarquivo.txt","D:\amarildo\Copia\novoarquivo.txt")
//Blog com Video e exemplo http://windevdesenvolvimento.blogspot.com.br/2016/08/curso-windev-arquivos-008-arquivos.html https://www.youtube.com/watch?v=Q05zcTyXV1c
|
|
|
|
| |
| |
| |
| |
| |
| |
| | |
|