Extracted from Pike v7.3 release 53 at 2002-09-10.
pike.ida.liu.se
[Top]
Stdio

Method Stdio.async_cp()


Method async_cp

void Stdio.async_cp(string from, string to, function(int:void) callback, mixed ... args)

Description

Copy a file asynchronously.

This function is similar to cp(), but works asynchronously.

Parameter from

Name of file to copy.

Parameter to

Name of file to create or replace with a copy of from.

Parameter cb

Function to be called on completion. The first argument will be 1 on success, and 0 (zero) otherwise. The rest of the arguments tp callback are passed verbatim from args.

Parameter args

Extra arguments to pass to callback.

Note

For callback to be called, the backend must be active (ie main() must have returned -1).

Bugs

Currently the file sizes are not compared, so the destination file (to) may be truncated.

See also

cp(), Stdio.sendfile