Topic "Exit Code 0 When 0 files are transferred with wildcards"

Author Message
flipman619
[View user's profile]

Joined: 2011-03-01
Posts: 8
Location: Southern California
I have noticed that whenever a wildcard is used in a trasnfer and 0 files are transferred, the return code is 0 (success). However, when trying to transfer the same file without the wildcard, it will return an exit code of 1 (failure) because winscp could not find any files. This seems inconsistent.

Is there anyway to return a failure code of 1 whenever no files match the mask regardless if a wildcard is used or not?

Or is there any option to change this behavior?

-Julius
flipman619
[View user's profile]

Joined: 2011-03-01
Posts: 8
Location: Southern California
flipman619 wrote:
I have noticed that whenever a wildcard is used in a trasnfer and 0 files are transferred, the return code is 0 (success). However, when trying to transfer the same file without the wildcard, it will return an exit code of 1 (failure) because winscp could not find any files. This seems inconsistent.

Is there anyway to return a failure code of 1 whenever no files match the mask regardless if a wildcard is used or not?

Or is there any option to change this behavior?

-Julius


I have confirmed this occurs with any command that uses the wildcard.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
flipman619 wrote:
Is there anyway to return a failure code of 1 whenever no files match the mask regardless if a wildcard is used or not?

No.
You can inspect XML log file to find out if any file was affected:
https://winscp.net/eng/docs/logging_xml
_________________
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