Truncate a file: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 149:
=={{header|Perl}}==
<lang perl># Open a file for writing, and truncate it to 1234 bytes.
open FOO, ">>file" or die;
truncate(FOO, 1234);
close FOO;
Line 158:
=={{header|Python}}==
<lang python># Open a file for writing, and truncate it to 1234 bytes.
f = open("file", "ab")
f.truncate(1234)
f.close()</lang>
Anonymous user