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"
سؤال
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 ?
المحلول 2
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"
نصائح أخرى
Why not either:
For Linux, you can simply run any curl command or system command using q. I used following for example:
system "curl --proxy my_proxy_details ftp://ftp.microsoft.com/developr/visual_c/README.TXT -o README.txt"
-> -o option is to give name for the downloaded file.
Similarly you can run other curl commands or other system commands to get ftp files in Q.
This site has good curl examples: http://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/