Secure temporary file: Difference between revisions

Content added Content deleted
(temporary files in Octave)
(→‎{{header|Pascal}}: add example)
Line 152: Line 152:
filename = tmpnam (...); % generates temporary file name, but does not open file
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>
[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}}==
=={{header|Perl}}==