Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: perfect: thank you

bobmcrae wrote:

which lead me to believe that the
SynchronizeDirectories object returned a SynchronizationResult object

That's correct.

which returned TransferEventArgsCollection (an object). I see now under TransferEventArgsCollection, is listed Uploads (and Downloads).

The TransferEventArgsCollection is a type of .Downloads and .Uploads properties of SynchronizationResult result class/object.
bobmcrae

perfect: thank you

Using Uploads I was able to see that the COM error is avoided and I get the result I was looking for. Thank you.

I am coming at this as a beginner, so I was confused by the documentation, which lead me to believe that the
SynchronizeDirectories object returned a SynchronizationResult object which returned TransferEventArgsCollection (an object). I see now under TransferEventArgsCollection, is listed Uploads (and Downloads). However, can you help me (and others) understand at what point I use the object versus the test result (Uploads)?
bobmcrae

SynchronizationResult "Unknown name"

I am new to the use of the .NET assembly, but finding it incredibly better than scripting. However, I am having difficulty getting the results of a synchronization, which is actually succeeding. I'd like to see what files are transferred, but cannot seem to iterate through the SynchronizationResult. I am getting a COM error "Unknown name" for everything I have tried.

Perhaps I am misunderstanding that SynchronizationResult has a TransferEventArgsCollection that I can iterate through to get the .FileName of each transferred file. I'd appreciate clarity on the proper method.

I am using AutoIT and here is the code snippet causing issues:
; this works
$syncResult = $session.SynchronizeDirectories($syncMode, $localDir, $remoteDir, False)
If Not $syncResult.IsSuccess Then
SetError(-5)
Return False
EndIf

; here is where I am getting the COM error "Unknown name" for the $syncResult.Transfers object
; I have tried $syncResult.TransferEventArgsCollection, but that results in the same thing
For $transferItem in $syncResult.Transfers
ConsoleWrite($transferItem.FileName & @CRLF)
Next


Thanks in advance.