Topic "Add append function in PutFiles when using .Net Assembly"

Author Message
mickyg
[View user's profile]

Joined: 2015-04-15
Posts: 5
Hi,

Are there any future plans to implement the functionality currently marked as "not supported" in the PutFiles method (see here: https://winscp.net/eng/docs/scriptcommand_put), i.e. the append, resume and neweronly switches.

If so, is there a timescale for this, if not, is there a reason why they won't be implemented?

Many thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Thanks for your suggestion.
We will definitely at these once there is a demand.

You can easily add append support yourself, the .NET assembly is open source:

Code:
public TransferOperationResult PutFiles(string localPath, string remotePath, bool remove = false, TransferOptions options = null, append = false)

    ...

    WriteCommand(
        string.Format(CultureInfo.InvariantCulture,
            "put {0} {1} {2} -- \"{3}\" \"{4}\"",
            BooleanSwitch(remove, "delete"), BooleanSwitch(append, "append"), options.ToSwitches(),
            Tools.ArgumentEscape(localPath), Tools.ArgumentEscape(remotePath)));
mickyg
[View user's profile]

Joined: 2015-04-15
Posts: 5
Hi Prikryl,

Thanks for getting back to me so quickly with a suggested solution.

I'd love to contribute but after having a quick search around, besides the contributor license agreement, I couldn't find anything about how to contribute back to the project. I found that the WinSCP code is hosted on Sourceforge in a CVS repository but also on Github in a Git repository. Is there a particular route I should use or is it enough to just fork the project on Github and send you a pull request?

If you meant that I could just maintain my own copy of the code and patch it to add this append functionality after each official release, I'd personally prefer to avoid having to do that.

Alternatively (and without meaning to be cheeky) if it is a simple as your code snippet, could you not just add this feature to the next release?

Many thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
I will definitely add it to some future release. I'll just thing of a ,better interface than adding yet another argument to the function.
mickyg
[View user's profile]

Joined: 2015-04-15
Posts: 5
Perhaps adding it to the TransferOptions class might be a better place?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
That's one of the options. But that's also used for Session.SynchronizeDirectories, where appending does not make sense.
_________________
Martin Prikryl
mickyg
[View user's profile]

Joined: 2015-04-15
Posts: 5
Hi Martin,

Has there been any progress on adding these features to the .Net assembly?

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Not yet.
mickyg
[View user's profile]

Joined: 2015-04-15
Posts: 5
Hi Martin,

Has there been any progress on adding these features to the .Net assembly?

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
It has been implemented already:
https://winscp.net/tracker/show_bug.cgi?id=1358
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