I have to read a file in an Ada program and get the file content in some string.
Any tips on how to do that?
I have to read a file in an Ada program and get the file content in some string.
Any tips on how to do that?
You can use the Ada Util library for that.
The @@Read_File@@ procedure is here for that:
/// with Ada.Strings.Unbounded; with Util.Files; ... Content : Ada.Strings.Unbounded.Unbounded_String; ... Util.Files.Read_File (Path => "file.txt", Into => Content); ///