understanding copy

I’m looking at the copy module to get my head around trying to write my own module. Am I interpreting the code correctly when I say that copy always copys a file to the remote host, then runs md5sums on both files on the remote host, then overwrites the destination file if they do not match?

Thanks,
Nathan

Yes. That’s what it does, but not what it should do. (Not a bug really, just the absence of an optimization that really ought to be there)

Presently, the “if does not match” stuff was originally done to support notifiers, not really to be efficient.

Patches to upgrade this are very welcome.

that’s good at least I’m on the right track. When does the file identified by src get copied to the remote machine? By when I really mean: Where in the code?

I found a cool little utility to do an md5sum without even fully loading a file, so I might be able to provide that patch once I get my head around this a bit more.

Nahtan