Re: Read-line issue in Win64 when reading files.

Stas Boukarev <[email protected]> Fri, 21 Nov 2025 16:56:30 +0300
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAF63=111cyPaieu=h-5JYW8RhJhR+vTF4uND=5Gos40irvzUCg@mail.gmail.com>
Open the file with :external-format '(:default :newline :crlf)

On Fri, Nov 21, 2025 at 4:50 PM Uģis Lācis <[email protected]> wrote:
>
> Hi SBCL users and developers,
>
>
>
> I recently stumbled upon a problem with (read-line) using Win64 version of SBCL. It seems very similar to this old bug:
> Bug #1587197 “read-line in Win64 is non-conforming” : Bugs : SBCL
>
> However, also for file access. To recreate, use the simple attached text example by executing:
> * (load "read-line.lisp")
>
> T
>
> * (test-reading)
>
>   0: (READ-LINE
>
>       #<SB-SYS:FD-STREAM for "file C:\\example_text_windows.txt" {1101C8F9F3}>)
>
> " NILREAD-LINE returned "Some text in first line
>
> #\Return
>
> *
>
> What happens is essentially the same as described in the bug, read-line returns a non-clean string, i.e., last character being “#\Return”. This is a bit annoying as I am often trying to compare the read-line result with some string and “#\Return” character screws up the comparison. As a workaround, I have implemented a wrapper function to remove the trailing “#\Return” character, but I wonder if there is any plan to fix this bug? I did the above test in the latest SBCL build for Win64, 2.5.10.
>
>
>
> Best wishes,
> Ugis
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help


_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help