Differences

This shows you the differences between the selected revisions of the page.

2017-01-07 2017-05-12
explicit anchor use (martin) script_downloading_when_done_file_exists (martin)
Line 19: Line 19:
See complete [[library_session_fileexists#powershell|PowerShell example for Session.FileExists]]. See complete [[library_session_fileexists#powershell|PowerShell example for Session.FileExists]].
-If you are not looking for a specific file, but for any file matching a mask (e.g. ''*.txt''), you can use the ''[[library_session_enumerateremotefiles|Session.EnumerateRemoteFiles]]''.+If you are not looking for a specific file, but for any file matching a mask (e.g. ''*.txt''), you can use the ''[[library_session_enumerateremotefiles|Session.EnumerateRemoteFiles]]''. For a complex example, that uses this technique, see [[script_downloading_when_done_file_exists#separate|Downloading files from FTP/SFTP server only after "done" file is created]].
~~AD~~ ~~AD~~
Line 45: Line 45:
exit /b 1 exit /b 1
</code> </code>
 +
 +If the further processing involves WinSCP commands, you can add the commands directly to the main WinSCP script, just after the ''stat'' command. For an example, see [[script_downloading_when_done_file_exists#fixed_scripting|Downloading files from FTP/SFTP server only after "done" file is created]].
To check for existence of any file matching a mask, instead of a specific file, enable ''[[scriptcommand_option#failonnomatch|option failonnomatch on]]'' mode and use ''[[scriptcommand_ls|ls mask]]'' command, instead of ''stat name'' command: To check for existence of any file matching a mask, instead of a specific file, enable ''[[scriptcommand_option#failonnomatch|option failonnomatch on]]'' mode and use ''[[scriptcommand_ls|ls mask]]'' command, instead of ''stat name'' command:

Last modified: by martin