You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
784 B

4 years ago
(in-package #:lolisp)
(defmacro str (&rest strs)
`(concatenate 'string ,@strs))
(defun copy-stream (from to &key (buffer-size 4096)
&aux (buffer (make-array buffer-size :element-type '(unsigned-byte 8))))
(loop for bytes-read = (read-sequence buffer from)
while (plusp bytes-read)
do (write-sequence buffer to :end bytes-read)))
(defun real-copy-file (from to)
(with-open-file (from from :direction :input
:element-type '(unsigned-byte 8))
(with-open-file (to to :direction :output
:if-exists :supersede
:element-type '(unsigned-byte 8))
(copy-stream from to))))
(defun real-move-file (from to)
(real-copy-file from to)
(delete-file from))