Script

FTP

The professional tool to automate FTP, SFTP, FTPS and Batch FTP

  • Home

  • FORUM INDEX
Missing any feature or command? Post your ideas here. Suggestions are welcome.
 #14885  by johnhom
 12 Dec 2016, 17:06
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
 #14887  by ScriptFTP support
 12 Dec 2016, 19:40
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).
 #14934  by ScriptFTP support
 20 Jan 2017, 20:15
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:

[scriptftp]GETLIST($fileList,REMOTE_FILES,GETPARAM(3))

FOREACH $file IN $fileList
PRINT($file)
PRINT(GETFILETIME(REMOTE,$file))
PRINT(GETFILESIZE(REMOTE,$file))
PRINT("---")
END FOREACH[/scriptftp]

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