RosettaCodeData/Task/Truncate-a-file/Perl/truncate-a-file.pl
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

7 lines
173 B
Perl

# Open a file for writing, and truncate it to 1234 bytes.
open FOO, ">>file" or die;
truncate(FOO, 1234);
close FOO;
# Truncate a file to 567 bytes.
truncate("file", 567);