Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downloading FTP files in Q (KDB)

Tags:

ftp

kdb

q-lang

Does anybody know if there is any way to download files from ftp server directly from Q (kdb) ? I know that it's possible to use http but didn't see any examples of using ftp. Seems only way is to write wrapper around something like curl etc, but may be it is already done ? Any thoughts ?

like image 680
mde Avatar asked Mar 19 '23 17:03

mde


2 Answers

Why not either:

  • Write a script to fetch the file then start the q processing.
  • Use a system command to call any linux/dos commands you want, then use the kdb key command to check that the files exist as expected
like image 123
Ryan Hamilton Avatar answered Mar 22 '23 09:03

Ryan Hamilton


use a system call to curl without a file destination -- its default destination is stdout, so the file contents will be returned to q as the return value of system

data:system"curl ftp://wherever/whatever"

like image 37
Aaron Davies Avatar answered Mar 22 '23 09:03

Aaron Davies