WinSCP .NET library - rename command vs.non-matched wildcard on remote end results in error
Hi,
If you use the library and issue a wildcard rename like this (this is a PowerShell excerpt):
$filestotransfer = ($dirpair.source + "/" + $dirpair.mask)
$destmask = $dirpair.mask + $mysuffix
$sess.MoveFile($filestotransfer, $destmask)
If the mask for the source does not have any matches, you have an error like this:
Element "mv" not found in the log file
Guess the case when the wildcard does not match is not handled properly. It can be worked around by fetching a filelist and checking with a regex if any of the files will match, and only run the command if there is something for ti to actually do, but it is a pain in the back IMHO, and a workaround anyway. Could someone please do something about that?
thanks, regards,
--
J
If you use the library and issue a wildcard rename like this (this is a PowerShell excerpt):
$filestotransfer = ($dirpair.source + "/" + $dirpair.mask)
$destmask = $dirpair.mask + $mysuffix
$sess.MoveFile($filestotransfer, $destmask)
If the mask for the source does not have any matches, you have an error like this:
Element "mv" not found in the log file
Guess the case when the wildcard does not match is not handled properly. It can be worked around by fetching a filelist and checking with a regex if any of the files will match, and only run the command if there is something for ti to actually do, but it is a pain in the back IMHO, and a workaround anyway. Could someone please do something about that?
thanks, regards,
--
J