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

Uģis Lācis <[email protected]> Fri, 21 Nov 2025 15:23:56 +0000
Newsgroups gmane.lisp.steel-bank.general
Message-ID <GV3P280MB1420F75EDCA9C7D94BD3E49E90D5A@GV3P280MB1420.SWEP280.PROD.OUTLOOK.COM>
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