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

igor123

Thank you
martin

igor123 wrote:

No. In the previous version WinSCP reached the occupied file and if WinSCP could not copy it, WinSCP stopped working and gave an error. In the new version of WinSCP it comes to this file and hangs. And the error does not give out and the work does not stop. What to do?

I've found a bug that causes the session to hang, if you set QueryReceived after calling Open.
https://winscp.net/tracker/1600

Before the fix is released, just move add_QueryReceived before Open.
igor123

martin wrote:

OK, so you were asking, if your code is correct? Yes, it's look good to me.


No. In the previous version WinSCP reached the occupied file and if WinSCP could not copy it, WinSCP stopped working and gave an error. In the new version of WinSCP it comes to this file and hangs. And the error does not give out and the work does not stop. What to do?
martin

OK, so you were asking, if your code is correct? Yes, it's look good to me.
igor123

martin wrote:

igor123 wrote:

Another question: what should be the code to enable this function? Such?

Sorry, I do not understand, what you mean by "enable this function".


To enable the "continue on error mode"
martin

igor123 wrote:

Another question: what should be the code to enable this function? Such?

Sorry, I do not understand, what you mean by "enable this function".
igor123

Sorry! Itself was mistaken.

Another question: what should be the code to enable this function? Such?


function func_sync {
$session.add_QueryReceived( { $_.Continue() } )
$synchronizationResult =
$session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote, $args[0], $args[1], $True)

# Throw on any error
$synchronizationResult.Check()
}
igor123

In the new version, an error occurred while calling the Open method:

"Incompatible external console protocol version 8."
martin

Re: Synchronization Error

igor123 wrote:

Hello. I sent you a letter.

I have responded.
igor123

Re: Synchronization Error

martin wrote:

.NET assembly now supports custom error handling nativelly.
If you are interested in testing this functionality, send me an email, so I can send you back a development version of WinSCP. Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.


Hello. I sent you a letter.
martin

Re: Synchronization Error

.NET assembly now supports custom error handling nativelly.
If you are interested in testing this functionality, send me an email, so I can send you back a development version of WinSCP. Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
martin

igor123 wrote:

Thanks, but it's the same as calling the function SynchronizeDirectories(). And my problem is not solved in any way, because if the script can not copy the file, it will also give an error and stop working

I do not understand what you mean by "same as calling the function SynchronizeDirectories()".
The script copies one file only, you need to modify it to copy more files.
You can combine the script with:
https://winscp.net/eng/docs/library_example_recursive_download_custom_error_handling
igor123

Thanks, but it's the same as calling the function SynchronizeDirectories(). And my problem is not solved in any way, because if the script can not copy the file, it will also give an error and stop working
igor123

help me
igor123

unfortunately I do not know how
martin

igor123 wrote:

That is, this error can not bypass?

Not with simple SynchronizeDirectories call.
You can of course implement the synchronization yourself with error handling you like. It's not difficult to implement with WinSCP .NET assembly.
igor123

That is, this error can not bypass?
martin

Re: Synchronization Error

igor123 wrote:

Found that in scripts you can use "option batch continue". But how to do this in the .NET assembly?

This mode is not supported in the assembly yet.
igor123

Really such it is impossible to make?
igor123

Synchronization Error

Hello.

There is a script that synchronizes the directory to a remote server. If files that can not be read are encountered during synchronization, the synchronization stops and the script ends. In the broad gulls:

Exception when calling "Check" with "0" arguments: Can't open file '***.DBF'.
System Error. Code: 32. The process can not access the file, since this file is occupied by another process

How can I skip such files so that the synchronization is not completed, but continued?

Found that in scripts you can use "option batch continue". But how to do this in the .NET assembly?

Thank you.