Richer scripting

Advertisement

trybowski
Joined:
Posts:
4
Location:
Kraków

Richer scripting

Hello,
it would be great to have more feature rich scripting available. This would facilitate using WinSCP as a part of .bat process.

The features I'd like are:

* if file xxx exists do that
* if file xxx is a file do that
* if file xxx is a direcotry do that

* if the above command suceeded set winscp exitcode to x
* if the above command failed set winscp exitcode to x

Probably others could think of more features, but right now I desperately lack the above.

Reply with quote

Advertisement

trybowski2
Guest

This is not planned at all atm. We are not going to implement yet another scripting language.

See documentation to learn how to use WinSCP from common scripting (and other) languages: https://winscp.net/eng/docs/guide_automation_advanced

I think you might have misunderstood the intention. I know I can use local scripting and I do use it. The problem is with remote site. For example I want to transfer some local files into a directory called ~/ABC/DEF but it may or may not exist. There's no way to check its existence in local script. I could just call the mkdir command each time, but most of the time the directory already exists and this would cause an error (WinSCP exit code is the 1 and my script reports an error).

My request isn't about a full-featured scripting -- I only need some basic file-management related commands. After all you have made a first step: the "-delete" option of put and get is a way to say "if the transfer was successful, delete the source file". Now -- is that scripting?

I would try to code that myself, but being a non-programmer makes that nearly impossible...

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,440
Location:
Prague, Czechia

trybowski2 wrote:

I think you might have misunderstood the intention. I know I can use local scripting and I do use it. The problem is with remote site. For example I want to transfer some local files into a directory called ~/ABC/DEF but it may or may not exist. There's no way to check its existence in local script. I could just call the mkdir command each time, but most of the time the directory already exists and this would cause an error (WinSCP exit code is the 1 and my script reports an error).
I understand. The link I've posted, shows how to do that.

Reply with quote

Advertisement

You can post new topics in this forum