Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

MENU MENU
Missing any feature or command? Post your ideas here. Suggestions are welcome.
ScriptFTP has many wonderful features such as getting a list of remote files, getting file dates and file sizes. The problem is that this information is kept internal to ScriptFTP. It would be wonderful if this information could be returned to the caller. For example:


[ScriptFTP]GETLIST($fileList,REMOTE_FILES,GETPARAM(3))
# the following line is only an idea. it does not actually works
return($fileList)[/ScriptFTP]

My code could then retrieve the list of files and process them.

John
wonderful if this information could be returned to the caller.
Do you mean the program that calls ScriptFTP.exe? if this is what you mean it is not possible, sorry. An exe can only retun to the caller a status code (a number).
In console applications for the transfer conveyer goes through stdout. Maybe try PRINT($fileList).
Sorry for my English, I use Google translator.
Yes, Wandrey, thanks for pointing this out.

If you use the command line version of ScriptFTP (ScriptFTP_console.exe). You can just print what you need (files, sizes etc). The program that calls ScriptFTP_console.exe then needs to capture its output.

Something like:
FTP Script
  1. GETLIST($fileList,REMOTE_FILES,GETPARAM(3))
  2.  
  3. FOREACH $file IN $fileList
  4.     PRINT($file)
  5.     PRINT(GETFILETIME(REMOTE,$file))
  6.     PRINT(GETFILESIZE(REMOTE,$file))
  7.     PRINT("---")
It should print, for example:
myfile1.txt
2017_01_03-12:43:32
325
---
myfile2.txt
2017_01_02-19:03:21
32
---
myfile3.txt
2017_01_03-15:23:01
4214
---