The node you are looking for is at gnat_rm/the_implementation_of_standard_i_o treating-text-io-files-as-streams.