Truncate a file: Difference between revisions
→{{header|Fortran}}
imported>Arakov |
|||
(One intermediate revision by one other user not shown) | |||
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"
|