source: tags/1.7.0/tools/resource.lisp

Last change on this file was 15108, checked in by Mark Evenson, 7 years ago

Move tools system definition into main ASDF file

Start basic retrieval of resources.

Experiment with package per file strategy.

TODO untangle <file:tools/code-grapher.lisp> and
<file:tools/check.lisp> compile-time side effects so that they may be
properly encapsulated in ASDF:DEFSYSTEM forms.

File size: 412 bytes
Line 
1(defpackage abcl/tools/resource
2  (:use #:cl)
3  (:export
4   #:retrieve))
5
6(in-package :abcl/tools/resource)
7
8(defun retrieve (uri &key (destination #p"resource.get"))
9  (let ((stream (dexador:get uri :want-stream t)))
10    (alexandria:with-output-to-file (output destination)
11      (alexandria:copy-stream stream output))
12    (values ;; TODO track the number of bytes retrieved
13     (truename destination))))
14 
15
Note: See TracBrowser for help on using the repository browser.