Topic "Possible TransferResult Bug"

Author Message
[View user's profile]

Joined: 2015-03-11
Posts: 3
Location: NJ, USA

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

WinSCP v5.7.0.0
Using automation along with Tom Malkewitz's WinSCP Powershell Module (
SFTP transfer protocol

If i try and 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.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
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.

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License