Topic "Richer scripting"

Author Message
trybowski
[View user's profile]

Joined: 2010-01-13
Posts: 3
Location: Krakw
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Thanks for your post. This request has been added to tracker.
_________________
Martin Prikryl
trybowski2

Guest


Quote:
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: http://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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
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.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License