AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Error handling
  • Creating directories during the copy
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Copies one or more files (regardless of their attributes).
WEBDEV - Código ServidorPHPAjax
// Copy "File.doc" to "FileCopy.doc"
Res = fCopyFile("C:\Directories\File.doc", "D:\Documents\FileCopy.doc")
WEBDEV - Código ServidorPHPAjax
// Copy the files found in the "C:\MyImages" directory
// The subdirectories and their files are taken into account (frRecursive constant)
ResCopy = fCopyFile("C:\MyImages\*.*", "D:\MyFiles\", frRecursive)
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:
  • WindowsLinux 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:
  • 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:
  • WindowsLinux This parameter can be in Ansi or Unicode format.
<Copy indicator>: Optional constant
Type of copy:
frConfirmCopy a file and ask for confirmation before overwriting a file with the same name.
WEBDEV - Código ServidorPHP 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 - Código ServidorPHP 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.
PHP Not available in PHP

Copying one or more files by handling each copied file Ocultar los detalles

<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 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:
  • WindowsLinux This parameter can be in Ansi or Unicode format.
Wildcard characters management (*,?): By default, wildcard characters are allowed 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:
  • 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 fCopyFile.
<Pointer>: Optional integer
Pointer passed to <Procedure name>.
<Copy indicator>: Optional constant
Type of copy:
frRecursiveRecursive copy of the files. The subdirectories and their files are taken into account.

By default, <Indicateur de copie> is empty: processing is not recursive.
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.
  • WEBDEV - Código ServidorAjax 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
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
EXEMPLO COPIAR ARQUIVO
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")

De matos
29 05 2018
Copiar Arquivo
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
De matos AMARILDO
01 09 2016

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local