ccpRegMonitor
ccpRegMonitor(g_copyMonitor) =>oldCopyMonitor/nil
Description
Registers the copy monitor that you create. A copy monitor is a program that displays the progress of the copy command while it is being executed.
Arguments
Value Returned
Examples
crm_ret = ccpRegMonitor('copyMonitor)
printf("ccpRegMonitor returned \"%L\"\n" crm_ret)
Additional Information
If you want to write a copy monitor function, you must write it in the format described in this section.
The copy monitor function must be fast, otherwise it will affect the performance of the copy command.
The copy monitor must return nil for the copy operation to continue; any non-nil return value cancels the copy operation.
Use the following format for the copy monitor function that you write:
procedure(copyMonitor(myFunctioncopyPhasefromPathtoPathfromSpectoSpecnumCountnumTotal"ttttggxx"))
=> nil / non-nil
- myFunction is your copy monitor function’s symbol.
-
copyPhase is the string
"copy". -
fromPath is the path (specified as a string) of the file that is being copied.
An empty string is also a legal value. -
toPath is the path (specified as a string) to which the file is copied.
An empty string is also a legal value. -
fromSpec is the gdmSpec object of the file that is being copied.
nilis also a legal value. -
toSpec is the destination gdmSpec object.
nilis also a legal value. -
numCount is the count, which is incremented by 1 for each file that is copied.
The count is terminated at -1: for every copy operation, there is a final call to the copy monitor withnumCount = -1. -
numTotal is the total number of files that have to be copied.
This number may vary during a copy operation, for example, it may increase when the cellview subdirectories are expanded. If this number is negative, it indicates that the copy operation is failing.
The following example creates a copy monitor function that prints some of its arguments.
procedure(copyMonitor(
copyFn copyPhase fromPath toPath fromSpec toSpec numCount numTotal "ttttggxx")
if(geqp(numCount 0) then
if(neq(fromSpec nil) then
printf("Monitor: %s %L -> %L, %d of %d files.\n"
copyFn
gdmInspectSpec(fromSpec "CDBA")
gdmInspectSpec(toSpec "CDBA")
numCount numTotal)
))
nil
)
Related Topics
Return to top