Add append function in PutFiles when using .Net Assembly

Advertisement

mickyg
Joined:
Posts:
5

Add append function in PutFiles when using .Net Assembly

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

Reply with quote

Advertisement

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

Re: Add append function in PutFiles when using .Net Assembly

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:

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)));

Reply with quote

mickyg
Joined:
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

Reply with quote

martin
Site Admin
martin avatar

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

That's one of the options. But that's also used for Session.SynchronizeDirectories, where appending does not make sense.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum