Gentee Programming Language > Documentation > Libraries Download documentation

The handler of copyfiles messages

In the process of copying the function copyfiles generates various messages and you can specify a function to handle them. The function must have the following structure:

func uint yourfunc( uint code, uint left, uint right )

The code parameter is the code of the message and the type of the other two parameters depends on code of the message.
 
Message codeDescriptionSecond parameterThird parameter
$COPYN_FOUNDThe object for copying is foundThe finfo structure about the found file or directorystr with the name of the target file or directory
$COPYN_NEWDIRA directory is createdstr - directory name 
$COPYN_ERRDIRCannot create a directorystr - directory name 
$COPYN_ASKCopy requestfinfo - source filefinfo - existing file
$COPYN_ERRFILEError while creating a filestr - file name 
$COPYN_NEWFILEA file is createdstr - file name 
$COPYN_BEGINStart copying filefinfo - source filestr - target file
$COPYN_PROCESSA file is being copiedstr - target file nameuint - progress of copying
$COPYN_ENDCopying is overfinfo - source filestr - target file
$COPYN_ERRWRITEError while writing a filestr - file name 

By default, the function must return 0 or $COPYR_NOTHING, but the following variants are possible for some messages.
 
Message codeReturn values
$COPYN_ERRDIR$COPYR_RETRY - retry
$COPYR_BREAK - stop copying
$COPYN_ASK$COPYR_OVER - overwrite
$COPYR_SKIP - skip
$COPYR_OVERALL - copy this file and all the rest
$COPYR_SKIPALL - skip this file and all the rest
$COPYR_BREAK - stop copying
$COPYN_ERRFILE
$COPYN_ERRWRITE
$COPYR_RETRY - retry
$COPYR_BREAK - stop copying
$COPYR_SKIP - skip

You can use the console message handler defcopyproc and specify &defcopyproc as a function for handling messages.

See also

    copyfiles


 Copyright © 2004-2006 Gentee Inc. All rights reserved.