Quoth Thien-Thi Nguyen <t...@gnuvola.org>: > () Sebastian Tennant <seb...@smolny.plus.com> > () Sun, 10 May 2009 16:21:29 +0000 > > (with-output-to-file (string-append USER-UPLOAD-DIR upload-fname) > (lambda () > (display upload))) > > Perhaps you can convert the string in variable `upload' to a uniform vector > and write it out using `uniform-vector-write'. It may be the case, too, > that the string can be passed to `uniform-vector-write' directly, e.g.: > > (with-output-to-file (string-append USER-UPLOAD-DIR upload-fname) > (lambda () > (uniform-vector-write upload)))
Nope. On closer inspection, it is the call to (cgi:upload ...) which throws the error so there is no way of converting the result to a vector before trying to write it to disk. cgi.scm: (define (upload name) (and=> (uploads name) car)) cgi.scm is so full of closures it makes my head swim but from what I can gather the upload is extracted and stored in memory at the initialisation stage (cgi:init) which would suggest to me that the problem doesn't lie within the procedure parse-form-multipart as this is called by (cgi:init). Given that guile 1.8.6 can actually handle null chars in strings (despite what the error message says) what could the problem be? Seb P.S. Documentation bug - the procedure 'and=>' is missing from the manual. What's the difference between the way the upload procedure is written above and simply: (define (upload name) (car (uploads name))) -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap