Skip to content

Instantly share code, notes, and snippets.

@ishideo
Created October 13, 2016 02:58
Show Gist options
  • Save ishideo/1d0a6af8c3c02c53ec5c7338cd808aba to your computer and use it in GitHub Desktop.
Save ishideo/1d0a6af8c3c02c53ec5c7338cd808aba to your computer and use it in GitHub Desktop.
#!/usr/bin/env gosh
(use rfc.ftp)
(define *username* "xxx")
(define *ftp-server* "ftp.xxx.xxx")
(define *client-path* "/xxx/xxx/xxx/xxx.txt")
(define *server-path* "/xxx/xxx/xxx.txt")
(define (main args)
(print "input password:")
(call-with-output-file *client-path*
(lambda (out)
(ftp-get
(ftp-login *ftp-server* :passive #t :username *username* :password (read)) *server-path* :sink out :flusher (lambda _ #t))
out))
(print "Done!")
0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment