Skip to content

TextIO.inputAll doesn't set TextIO.endOfStream #649

Description

@Skyb0rg007

The TextIO.inputAll function reads the entire input from an input stream, but after doing so endOfStream still returns false.

(* test.sml *)
val s = TextIO.openString "x"
val () = TextIO.print ("endOfStream = " ^ Bool.toString (TextIO.endOfStream s) ^ "\n")
val () = TextIO.print ("inputAll = \"" ^ String.toString (TextIO.inputAll s) ^ "\"\n")
val () = TextIO.print ("endOfStream = " ^ Bool.toString (TextIO.endOfStream s) ^ "\n")
$ mlton test.sml && ./test
endOfStream = false
inputAll = "x"
endOfStream = false

$ poly < test.sml
Poly/ML 5.9.2 Release
endOfStream = false
inputAll = "x"
endOfStream = true
val s = ?: TextIO.instream

$ sml < test.sml
Standard ML of New Jersey [Version 2026.1; 64-bit; March 14, 2026]
- = endOfStream = false
inputAll = "x"
endOfStream = true
val s = - : TextIO.instream

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions