Russell McManus <russell_mcmanus@...> writes:
> Any size other than 512 fails as above. Is this intended behavior?
I think so. Well, I think you're falling into a trap that's been
(unintentionally) laid for you, lurking for months if not years.
I would suggest using sb-sys:read-n-bytes on a byte stream, not a
character stream, and converting the octets you get from reading them
into a string using octets-to-string. The SBCL internal machinery is
such that it never calls sb-sys:read-n-bytes on a character stream
directly, I believe, but we don't detect violations -- and before the
implementation of Unicode, this didn't matter because strings and
(unsigned-byte 8) vectors had identical memory layout.
I don't know if this solves your actual problem, but if you can rework
the I/O layer to use octets, I think that's more likely to work.