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.Directories,
ada.Direct_IO,
ada.Streams.Stream_IO,
ada.Text_IO;
@@ -61,13 +62,15 @@ is
procedure store (Filename : in forge.Filename; the_String : in String)
is
use ada.Text_IO;
use ada.Streams.Stream_IO;
File : File_type;
S : Stream_access;
begin
create (File, out_File, String (Filename));
put (File, the_String);
close (File);
create (File, out_File, String (Filename));
S := Stream (File);
String'write (S, the_String);
close (File);
end store;