Next: posix find, Previous: posix curl, Up: posix [Index]
(vicare posix wget) exports a simple API to
download files through the external program
library is a demonstration of the basic mechanism needed to execute an
external program and read data from its standard output and standard
The source distribution of Vicare includes a simple demo program demo-wget.sps in the tests subdirectory of the source tree.
The executable file
wget must be reachable in the current
PATH; the library does not use default options for the
command line of
wget; the ASCII text displayed on the
standard output and standard error is captured for diagnostic.
Perform an operation spawning a subprocess that launches
Each option must be a string representing a
line argument. When successful: return two strings representing the
wget to, respectively, standard output and standard
error; otherwise raise an exception.
#!r6rs (import (vicare) (vicare posix wget)) (define (get-it url) (receive (out err) (wget "--output-document=-" url) (display out) (newline) (display err) (newline) (flush-output-port (current-output-port)))) (get-it "http://marcomaggi.github.io/index.html")