(defun read-file-to-usb8-array (file)
"Opens a reads a file. Returns the contents as single unsigned-byte array"
- (with-open-file (in file :direction :input)
+ (with-open-file (in file :direction :input :element-type '(unsigned-byte 8))
(let* ((file-len (file-length in))
(usb8 (make-array file-len :element-type '(unsigned-byte 8)))
(pos (read-sequence usb8 in)))
(write-char #\: stream)
(write-string (aref +datetime-number-strings+ minute) stream)))
-(defun copy-binary-stream (in out &key (chunk-size 4096))
+(defun copy-binary-stream (in out &key (chunk-size 16384))
(do* ((buf (make-array chunk-size :element-type '(unsigned-byte 8)))
(pos (read-sequence buf in) (read-sequence buf in)))
((zerop pos))
(unless (find value uniq :test test)
(push value uniq))))))
+
+
#+lispworks
`(mp:with-lock (,lock) ,@body)
#+sb-thread
- `(sb-thread:with-recursive-lock (,lock) ,@body)
+ `(sb-thread:with-mutex (,lock) ,@body)
#-(or allegro cmu lispworks sb-thread)
`(progn ,@body)
)
(defun close-active-socket (socket)
(close socket))
-#+sbcl
(defun ipaddr-to-dotted (ipaddr &key values)
"Convert from 32-bit integer to dotted string."
(declare (type (unsigned-byte 32) ipaddr))
(values a b c d)
(format nil "~d.~d.~d.~d" a b c d))))
-#+sbcl
(defun dotted-to-ipaddr (dotted &key (errorp t))
"Convert from dotted string to 32-bit integer."
(declare (string dotted))