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:
@@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user