Anonymous user
Secure temporary file: Difference between revisions
→{{header|Pascal}}: add example
(temporary files in Octave) |
(→{{header|Pascal}}: add example) |
||
Line 152:
filename = tmpnam (...); % generates temporary file name, but does not open file
[FID, NAME, MSG] = mkstemp (TEMPLATE, DELETE); % Return the file ID corresponding to a new temporary file with a unique name created from TEMPLATE.</lang>
=={{header|Pascal}}==
{{works with|Free_Pascal}}
{{libheader|SysUtils}}
<lang pascal>Program TempFileDemo;
uses
SysUtils;
var
tempFile: text;
begin
assign (Tempfile, GetTempFileName);
rewrite (tempFile);
writeln (tempFile, 5);
close (tempFile);
end.</lang>
=={{header|Perl}}==
|