lace.text.forge: Use Stream_IO instead of Text_IO when storing a string in a file to avoid the extra LF which Text_IO places at the end of a line when the file is closed.

This commit is contained in:
Rod Kay
2024-08-09 21:16:27 +10:00
parent d24de3e1f9
commit 56d8ff97e4

View File

@@ -2,6 +2,7 @@ with
ada.Characters.latin_1, ada.Characters.latin_1,
ada.Directories, ada.Directories,
ada.Direct_IO, ada.Direct_IO,
ada.Streams.Stream_IO,
ada.Text_IO; ada.Text_IO;
@@ -61,13 +62,15 @@ is
procedure store (Filename : in forge.Filename; the_String : in String) procedure store (Filename : in forge.Filename; the_String : in String)
is is
use ada.Text_IO; use ada.Streams.Stream_IO;
File : File_type; File : File_type;
S : Stream_access;
begin begin
create (File, out_File, String (Filename)); create (File, out_File, String (Filename));
put (File, the_String); S := Stream (File);
close (File); String'write (S, the_String);
close (File);
end store; end store;