Anonymous user
Write entire file: Difference between revisions
m
→{{header|Ada}}
m (→{{header|Ada}}) |
|||
Line 15:
=={{header|Ada}}==
<lang Ada>with Ada.Text_IO; use Ada.Text_IO;
procedure Write_Whole_File is
F : File_Type;
▲ File_Name : String := "the_file.txt";
Contents: String := "(Over)write a file so that it contains a string. " &▼
"The reverse of Read entire file—for when you want to update or " &▼
"create a file which you would read in its entirety all at once."; ▼
begin
begin
Open (F, Mode => Out_File, Name => File_Name);
exception
when Name_Error =>
end;
▲ "The reverse of Read entire file—for when you want to update or " &
Close (F);
end Write_Whole_File;
</lang>
=={{header|ALGOL 68}}==
|