GUI ScreenIO for Windows

 ScreenIO.com


CopyFile

The CopyFile API copies from an existing file to a new location, using a new name if specified.

Client/Server issues

If running in client/server mode, this API will copy a file from the server to the specified location on the client. 

To copy a file from one location to another location on the server:

     SET WIN32API-EXECUTE-API-ON-SERVER TO TRUE

To copy a file from the client to the server, use FUNC-COPYFILEFROMCLIENT.

Files

Files available to copy to your system:

Usage

     COPY WIN32API.
     COPY COPYFILE.

* ------------------------: Call the API.

     SET API-COPYFILE TO TRUE.

     CALL 'GSWINAPI' USING WIN32API-PARMS
                           CF-SOURCE
                           CF-DESTINATION
                           CF-FLAGS
                           WIN32API-D
                           WIN32API-E
                           WIN32API-F.

Parameters specific to this function

CF-SOURCE

Pathspec of source file (up to 1024 bytes).

CF-DESTINATION

Pathspec of destination (up to 1024 bytes).

CF-FLAGS

Copy options; set the desired one to TRUE before you call GSWINAPI.

To replace an existing file of the same name:

    SET CF-IF-EXIST-REPLACE TO TRUE

To fail if the target file exists:

    SET CF-IF-EXIST-FAIL TO TRUE

Same as CF-IF-EXIST-REPLACE, replaces the destination file:

    SET CF-SYNCHRONIZE-FILE TO TRUE

Note: When operating under Client Server, this option operates slightly different than CF-IF-EXIST-REPLACE.
CF-IF-EXIST-REPLACE will always copy the file from the server and replace the file on the client.  

The CF-SYNCHRONIZE-FILE option will copy the file from the server to the GUI ScreenIO Client's internal Cache and then it will replace the destination file on the client.  Upon subsequent calls to Copy the same file, it will compare date and time of the cached version and the server's version, and only transmit the file if it is different.  In all cases it will copy from cache to your destination.  This can be dramatically faster, and is meant as a way of distributing files to remote clients, and keeping those files up-to-date.

 

WIN32API-PARMS - Used in all GSWINAPI calls

This argument is standard for all CALLs to GSWINAPI. It is used to select the desired API or function, and to return the status of the operation.

WIN32API-RC

Used to return the status of a call to GSWINAPI.  A value of zero is a failure, any other value indicates success.

Recommended usage is to test the 88-level value WIN32API to see if it worked, then to use the text error message to see why it failed.

* ------------------------: If function failed,
*                         :   display the error in a message box.
*
     IF WIN32API-FAILED
       MOVE WIN32API-ERROR-TEXT TO panel-MESSAGE-TEXT
       SET panel-MESSAGE-IN-MESSAGEBOX TO TRUE.

WIN32API-ERROR-CODE

Error code that was returned by Windows.  This is not generally useful unless you have the Windows Platform SDK documentation available to you.

WIN32API-ERROR-TEXT

Plain-text error message that describes why the operation failed.

WIN32API-A through WIN32API-F

The number of these present varies depending on how many arguments are used by the desired function.  These are not used, but must be present because this CALL requires seven arguments.


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom