Secure temporary file: Difference between revisions
Content added Content deleted
m (→{{header|C}}) |
|||
Line 2: | Line 2: | ||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
Ada creates a temporary file whenever the create procedure is called |
Ada creates a temporary file whenever the create procedure is called without file name. That temporary file is automatically deleted at the end of the program creating the file. |
||
This example creates a temporary file, writes to the file, then reads from the file. |
This example creates a temporary file, writes to the file, then reads from the file. |
||
<ada> with Ada.Text_Io; use Ada.Text_Io; |
|||
procedure Temp_File is |
procedure Temp_File is |
||
Line 19: | Line 19: | ||
Get_Line(File => Temp, Item => Contents, Last => Length); |
Get_Line(File => Temp, Item => Contents, Last => Length); |
||
Put_Line(Contents(1..Length)); |
Put_Line(Contents(1..Length)); |
||
end Temp_File; |
end Temp_File;</ada> |
||
=={{header|C}}== |
=={{header|C}}== |