Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Re: Possible TransferResult Bug

That's correct (expected) behavior.

The localfile[1].pdf is a file mask (the [1] is a set pattern). If the mask matches no file, WinSCP won't transfer anything (and it's not an error). Note that localfile[1].pdf mask does not match the localfile[1].pdf file.

If you want to test that the transfer succeeded and something was actually transferred, test also TransferOperationResult.Transfers.Count > 0.
jbruett

Possible TransferResult Bug

Martin,

I think that I either found a bug or am unclear on intent of the TransferResult output.

WinSCP v5.7.0.0
Win2k12R2
Using automation along with Tom Malkewitz's WinSCP Powershell Module (https://github.com/tomohulk/WinSCP)
SFTP transfer protocol

If I try to download a file, say /remotedir/remotefile[1].pdf, the TransferOperationResult.IsSuccess reports True, even though the file was not downloaded to the local location. If I escape that path using the EscapeFileMask, which makes the new path /remotedir/remotefile[[]1].pdf the download works as expected and the local file is named c:\localdir\localfile[1].pdf as expected.