title: Writing drakma http-request array to file
body: <p>What I want to do:
  take the output of <code>(drakma:http-request "someURL.jpg")</code> and write it to a file. The output consists of a byte array.</p>
  
  <p>What I came up with: </p>
  
  <pre><code>(with-open-file (my-stream "thing.jpg" 
                             :direction :output
                             :element-type 'binary 
                             :if-does-not-exist :create
                             :if-exists :supersede)
    (let ((content (drakma:http-request "someURL.jpg")))
      (loop for i across content do
        (write-byte i my-stream))))
  </code></pre>
  
  <p>The error I get:</p>
  
  <pre><code>debugger invoked on a SIMPLE-ERROR in thread #&lt;THREAD "initial thread" RUNNING
                                                  {1002978FB1}&gt;:
    could not find any output routine for :FULL buffered BINARY
  </code></pre>
  
  <p>I use SBCL 1.0.49.
  If you want any other info or find my question unclear then please, ask away :).</p>
  
  <p>EDIT:
  The problem is the :element-type, it's supposed to be 'unsigned-byte.
  You can find information on the different possibilities of :element-type over at the Common Lisp Hyper Spec under <a href="http://www.lispworks.com/documentation/HyperSpec/Body/f_open.htm" rel="nofollow">open</a> . Other than that everything is correct. </p>
  
  <p>PS. I couldn't respond as an answer because my reputation is too low.</p>