建立並寫入檔案

Ada.Text_IO的程式 CreatePut_LineClose 用於建立和寫入檔案 file.txt

with Ada.Text_IO;

procedure Main is
   use Ada.Text_IO;
   F : File_Type;
begin
   Create (F, Out_File, "file.txt");
   Put_Line (F, "This string will be written to the file file.txt");
   Close (F);
end;

Resulting file file.txt

This string will be written to the file.txt