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

Stas Boukarev <[email protected]> Fri, 21 Nov 2025 18:27:04 +0300
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAF63=12grz1LvoHSHzQ+gP6wbzt8i20jHEY8evBaFARk42x0Uw@mail.gmail.com>
You can also change sb-ext:*default-external-format*

On Fri, Nov 21, 2025 at 6:23 PM Uģis Lācis <[email protected]> wrote:
>
> Oh, cool, thanks! This solves the issue, good to know!
>
> Best,
> Ugis
>
> -----Original Message-----
> From: Stas Boukarev <[email protected]>
> Sent: Friday, 21 November 2025 14:57
> To: Uģis Lācis <[email protected]>
> Cc: [email protected]
> Subject: Re: [Sbcl-help] Read-line issue in Win64 when reading files.
>
> 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