|
|
|
|
Procedimiento WLanguage llamado por la función SCPSendFile Procedimiento WLanguage ("callback") llamado por la función SCPSendFile cuando se transfieren archivos a un equipo remoto utilizando el protocolo de copia segura (SCP). Este procedimiento permite obtener el progreso de la transferencia del archivo al equipo remoto. // Set up SSH session SSHSession is sshSession SSHSession.Address = "myserver.com" SSHSession.Port = 22 SSHSession.User = "username" SSHSession.UserPassword = "password" SSHSession.ConnectionTimeout = 2s sFileName is string = "accounting_january.docx" // File path on the local host sLocalFilePath is string = fExeDir() + [fSep()] + sFileName // File path on the remote host (Linux in this case) sRemoteFilePath is string = "~/accounting/" + sFileName // Transfer the file using SCP IF NOT SCPSendFile(SSHSession, sLocalFilePath, ... sRemoteFilePath, Progress) THEN Error(ErrorInfo(errFullDetails)) ELSE Info("File transfer completed") END // Progress monitoring (optional procedure) INTERNAL PROCEDURE Progress(nTotalSize, nCurrentSize) Trace(nCurrentSize + "/" + nTotalSize) END Sintaxis
SCPSendFile_Callback(<Total size> , <Size sent>)
<Total size>: Entero Tamaño total (en bytes) del archivo a enviar. <Size sent>: Entero Bytes enviados.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|