Skip to content

Instantly share code, notes, and snippets.

@cpach
Created March 23, 2011 18:45
Show Gist options
  • Select an option

  • Save cpach/883693 to your computer and use it in GitHub Desktop.

Select an option

Save cpach/883693 to your computer and use it in GitHub Desktop.
#lang racket
(require net/url)
(define (copy-url-to-file urlstr filepath)
(call/input-url (string->url urlstr)
get-pure-port
(lambda (input-port)
(call-with-output-file filepath
(curry copy-port input-port)))))
(copy-url-to-file "http://localhost/data" "/tmp/lol")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment