anchor.diff:  (defun check-bytes-per-sector (bytes-per-sector)
     "Ensure that bytes-per-sector is valid."
     (loop :for n :in '(512 1024 2048 4096)
  -     :do (when (= n bytes-per-sector)
  -           (return bytes-per-sector))
  -     :finally (error "Bad bytes-per-sector : ~a .
  +        :do (when (= n bytes-per-sector)
  +              (return bytes-per-sector))
  +        :finally (error "Bad bytes-per-sector : ~a .
   Valid bytes-per-sector are 512, 1024, 2048 and 4096" bytes-per-sector)))
   
   (defun check-sectors-per-cluster (sectors-per-cluster bytes-per-sector)
     (loop :for n :in '(1 2 4 8 16 32 64 128)
  -     :do (when (= n sectors-per-cluster)
  -           (return sectors-per-cluster))
  -     :finally (error "Bad sectors-per-cluster : ~a .
  +        :do (when (= n sectors-per-cluster)
  +              (return sectors-per-cluster))
  +        :finally (error "Bad sectors-per-cluster : ~a .
   Valid bytes-per-sector are 1,2,4,8,16,32,64,128" sectors-per-cluster))
     (when (> (* sectors-per-cluster bytes-per-sector)
              32768)
  
positive.code: (defmethod sys.gray:stream-element-type ((stream fat32-file-character-stream))
    'character)
  
  (defmethod sys.gray:stream-write-byte ((stream fat32-file-stream) byte)
    (error "Feature not implemented: ~a" 'sys.gray:stream-write-byte))
  
  (defmethod sys.gray:stream-read-byte ((stream fat32-file-stream))
    (assert (member (direction stream) '(:input :io)))
    (let ((char (aref (read-buffer stream)
                      (incf (read-buffer-offset stream)))))
      (if (<= (read-buffer-size stream)
              (read-buffer-offset stream))
          :eof
          char)))
  
  
negative.code: (defconstant +attribute-directory+ 4)
  (defconstant +attribute-archive+ 5)
  
  (defun file-p (cluster offset)
    (/= (ldb (byte 1 +attribute-directory+)
             (aref cluster (+ 11 offset)))
        1))
  
  (defun read-file (fat32 disk cluster start)
    (when (file-p cluster start)
      (read-cluster fat32
                    disk
                    (first-sector-of-cluster fat32
                                             (read-first-cluster cluster start)))))
  
  (defun read-first-cluster (cluster offset)
    (logior (ash (sys.int::ub16ref/le cluster (+ 20 offset)) 16)
            (ash (sys.int::ub16ref/le cluster (+ 26 offset)) 0)))
  
  (defun read-size (cluster offset)
    (sys.int::ub32ref/le cluster (+ 28 offset)))
  
  (defun checksum (cluster offset)
    "Return checksum of sort name"
    (loop :with sum := 0
          :for i :from offset :to (+ 10 offset)
          :for octet := (aref cluster i)
          :do (setf sum
                    (ldb (byte 8 0)
                         (+ (ash sum -1)
                            (ash (logand sum 1) 7) ; rotate
                            octet))) ; add next name byte
          :finally (return sum)))
  
  (defun next-file (cluster offset)
    (do ((i offset (+ 32 i)))
        ((<= (length cluster) i) nil)
      (let ((first-byte (aref cluster i)))
        (unless (or (zerop first-byte)
                    (= #xE5 first-byte))
          (unless (= #x0F (aref cluster (+ 11 i)))
            (return i))))))
  
  (defmacro do-files ((var) cluster &body body)
    `(do ((,var (next-file ,cluster 0) (next-file ,cluster (+ 32 ,var))))
         ((null ,var)
          t)
       ,@body))
  
  (defun read-name (cluster offset)
    (with-output-to-string (s)
      (loop :for i :from offset :to (+ 10 offset)
            :for octet := (aref cluster i)
            :do (write-char (code-char octet)))))
  
  (defmacro with-file ((var start) cluster finally &body body)
    (alexandria:with-gensyms (checksum)
      `(do ((,checksum (checksum ,cluster ,start))
            (,var ,start (- ,var 32)))
           ((zerop ,var)
            ,finally)
         (when (= ,checksum
                  (aref ,cluster (+ 13 ,var)))
           ,@body))))
  
  (defun read-long-name (cluster start)
    (let ((name ""))
      (with-file (i start) cluster
                 '()
        (progn (setf name
                     (concatenate 'string name
                                  (with-output-to-string (sub-name)
                                    (flet ((add (start end)
                                             (loop :for offset :from (+ start i) :to (+ end i)
                                                   :for octet := (aref cluster offset)
                                                   :when (and (/= octet 0)
                                                              (/= octet 255))
                                                     :do (write-char (code-char octet) sub-name))))
                                      (add 1 10)
                                      (add 14 25)
                                      (add 28 31)))))
               (when (= #x41 (aref cluster i))
                 (return name))))))
  
  (defun remove-file (cluster start disk sector fat32)
    (with-file (i start) cluster
               (write-cluster disk
                              sector
                              fat32
                              cluster)
               (setf (aref cluster i)
                     #xE5)))
  
  ;;; Host integration
  
  