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: Exit Code 0 When 0 files are transferred with wildcards

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
flipman619

Re: Exit Code 0 When 0 files are transferred with wildcards

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.
flipman619

Exit Code 0 When 0 files are transferred with wildcards

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