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

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.
trybowski2

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...
martin

Re: Richer scripting

Thanks for your post. This request has been added to tracker.
trybowski

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.