PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • and parameters
  • Creating directories during the copy
  • Managing the progress of the copy
  • Equivalence
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Copies one or more files:
  • from the current computer to the connected Mobile Device (Pocket PC).
  • from the connected Mobile Device (Pocket PC) to the current computer.
  • from the connected Mobile Device (Pocket PC) to another directory found on the Mobile Device (Pocket PC).
Notes:
  • The files can be copied only if a connection is established between the current computer and the Mobile Device (Pocket PC) (ceConnect).
  • Versions 20 and later
    This function is available in 64-bit mode.
    New in version 20
    This function is available in 64-bit mode.
    This function is available in 64-bit mode.
Example
// Copy the "Image.GIF" file found in the current directory
// from the current computer to the connected Mobile Device
// If this file already exists on the Mobile Device,
// this file is overwritten (ceOverwrite constant)
ResCopy = ceCopyFile(cePCToPocket + ceOverwrite, "Image.GIF", "\MyImages\Photo.GIF")
// Has a problem occurred?
IF ResCopy = True THEN
Info("The copy was performed.")
ELSE
Error(ErrorInfo())
END
// Copies the files found in the "\MyImages" directory
// on the Mobile Device (Pocket PC) to the current computer
// The sub-directories and their files are
// taken into account (ceRecursive constant)
ResCopy = ceCopyFile(cePocketToPC + ceRecursive, ...
"\MyImages\*.*", "C:\MyFiles\", ManageProgress)
// -- Code of the ManageProgress procedure
PROCÉDURE ManageProgress(TotalByte, TotalTransmitted)
// Displays the progress of the copy in the status bar
Message("Copy in progress: " + TotalTransmitted + " / " + TotalByte)
RESULT True
Syntax
<Result> = ceCopyFile(<Mode and Type of Copy> , <Source File> , <Destination File or Directory> [, <Procedure Name>])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. To find out the error details, use ErrorInfo.
<Mode and Type of Copy>: Integer constants
Mode of copy to perform:
cePCToPocketCopy from the current computer to the connected Mobile Device (Pocket PC).
cePocketToPCCopy from the connected Mobile Device (Pocket PC) to the current computer.
cePocketToPocketCopy from the connected Mobile Device to another directory found on the Mobile Device.

Type of copy to perform (optional constant):
ceOverwriteThe existing files are overwritten by the copied files.
ceRecursiveRecursive copy of the files: the sub-directories and their files are also copied.

No copy option is selected by default.
<Source File>: Character string (with quotes)
Name and full path of the files to copy (up to 260 characters).
The wildcard characters (*,?) are allowed in the name of the file and in the path.
<Destination File or Directory>: Character string (with quotes)
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • the name and full path of a file.
  • a full path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
<Procedure Name>: Optional character string (with or without quotes)
Name of a WLanguage procedure automatically called to check the progress of the copy.
This procedure cannot be called if the cePocketToPocket constant is used.
Remarks

<Source File> and <Destination File or Directory> parameters

If the file used corresponds to a file found on the current computer, these parameters can be:
  • the name of a file. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • the name of a file with its path (full or relative). A UNC path can be used.
If the file used corresponds to a file found on the connected Mobile Device, these parameters must necessarily correspond to the name and to the full path of the file to use.

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 ("C:\Temp\*.*" for example), the ceRecursive constant must be used to create the sub-directories in the destination (and to copy their content).

Managing the progress of the copy

To check the progress of the copy, ceCopyFile can automatically call the <Procedure Name> procedure at regular time intervals (every 100 KB).
This procedure is declared as follows:
PROCEDURE <Procedure Name>(<Total Size>, <Transferred Size>, <File Name>)
  • <Total Size> is an integer corresponding to the total size of file currently copied.
  • <Transferred Size> is an integer corresponding to the number of bytes already copied.
  • <File Name> is a character string corresponding to the name of the file currently copied.
In this procedure, you have the ability to:
  • display a progress bar,
  • find out whether the transfer is completed (<Total Size> = <Transferred Size>).
By default, ceCopyFile cannot be interrupted as long as all the files have not been copied. To force the interruption of the copy, use the following code line in <Procedure Name>:
RESULT False
In any other case (to continue the browse), <Procedure Name> MUST return True.
An error is generated if <Procedure Name> returns no value (neither True nor False).
Reminder: This procedure cannot be called if the cePocketToPocket constant is used.

Equivalence

The operating mode of ceCopyFile is equivalent to the operating mode of fCopyFile.
The only difference is:
  • ceCopyFile handles the files found on the Mobile Device from a WINDEV application.
  • fCopyFile handles the files found on the Mobile Device from a WINDEV Mobile application.
Components
WINDEVReports and Queries wd230ce.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment