Truncate a file: Difference between revisions
→{{header|Fortran}}
(2 intermediate revisions by 2 users not shown) | |||
Line 578:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'io;
import extensions;
Line 597:
{
if (program_arguments.Length != 3)
{ console.printLine
auto file := File.assign(program_arguments[1]);
Line 639:
0</syntaxhighlight>
=={{header|Forth}}==
<syntaxhighlight lang="forth">
: truncate-file ( fname fnamelen fsize -- )
0 2swap r/w open-file throw
dup >r resize-file throw
r> close-file throw ;
</syntaxhighlight>
=={{header|Fortran}}==
Fortran offers no access to any facilities the file system may offer for truncating a disc file via standard language features, thus in the absence of special routines or deviant compilers that do, you're stuck.
Line 699 ⟶ 706:
CALL FILEHACK("foobar.txt",12)
END</syntaxhighlight>
=={{header|FreeBASIC}}==
Line 1,569 ⟶ 1,575:
=={{header|Wren}}==
{{libheader|Wren-ioutil}}
<syntaxhighlight lang="
var fileName = "temp.txt"
|